01777777777777777777777 [std.conv.octal]

kdevel kdevel at vogtner.de
Thu Apr 7 20:52:38 UTC 2022


On Thursday, 7 April 2022 at 19:59:24 UTC, Steven Schveighoffer 
wrote:
[...]
>> The method does not work for most of the possible octal 
>> literals whose values fit in a ulong. I would call it an 
>> inconvenience method.
>
> It works for all numbers below 288,230,376,151,711,744 (i.e. up 
> to 58 bits).
>
> So, yeah, not all of them. But many of them.

For the record: 1 - 2^54 / 2^64 = .9843. I.e. for 98.4 % of all 
possible values fitting in a ulong ```template octal (alias 
decimalInteger)``` does **not** work.

> [...]
> We might want to just undocument the integer version.

I strongly recommend deprecation and removal. Imagine what 
happens if someone  forgets to type the quotation marks and gets 
a type which is wider than expected. The abolishment of the 
leading-zero octals shall not introduce another error category.


More information about the Digitalmars-d mailing list