Why don't underscores in numbers enforce proper formatting?

simendsjo simendsjo at gmail.com
Wed Mar 6 13:15:06 PST 2013


On Wednesday, 6 March 2013 at 21:06:43 UTC, ixid 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?

If someone uses different semantics on their numbers (like ISBN), 
having underscores in different places will help readability as 
the underscores can show the semantics of the number.


More information about the Digitalmars-d-learn mailing list