Why don't underscores in numbers enforce proper formatting?

Simen Kjærås simen.kjaras at gmail.com
Wed Mar 6 22:31:26 PST 2013


On Wed, 06 Mar 2013 22:06:42 +0100, ixid <nuaccount at gmail.com> wrote:

> The underscores in values such as 1_000_000 aid readability but DMD  
> doesn't see anything wrong with any placement of underscores as long as  
> they follow a number. Is there any reason to allow uses like 1_00_000,  
> which are typos or exceedingly lazy modifications of value, and not  
> enforce digits to form sets of three after the first underscore?

In addition to the examples given by Simen and Adam, China and Japan
place digits in groups of 4 (10 0000 0000), while India uses groups of 2
(10 00 00 00).

-- 
Simen


More information about the Digitalmars-d-learn mailing list