"R" suffix for reals

Arne arne at linux.nu
Mon May 7 11:11:34 PDT 2012


On Monday, 7 May 2012 at 12:34:26 UTC, Steven Schveighoffer wrote:
> On Sun, 06 May 2012 21:02:28 -0400, bearophile 
> <bearophileHUGS at lycos.com> wrote:
>
>> Or maybe you initially have written:
>> auto r = 1.1L;
>> And later you want to change the number to 1.0 and you fix it 
>> like this:
>> auto r = 1L;
>> Now you have a little bug.
>
> Or maybe you have initially written:
>
> auto d = 1.1;
> and later you want to change the number to 1.0 and you fix it 
> like this:
>
> auto d = 1;
>
> Now you have a little bug.
>
> To me the problem of floating pt. vs. integral is orthogonal to 
> the size of the integral/floating point.
>
> -Steve

Since you use the suffix to disambiguate / explicitly specify the 
type... it is extremely unintuitive if the type suddenly changes 
while *keeping* the same suffix...



More information about the Digitalmars-d mailing list