handling T.min the right way
Don Clugston
dac at nospam.com.au
Wed Mar 21 00:43:23 PDT 2007
0ffh wrote:
> 0ffh wrote:
>> Standard C defines that after "x++" x is incremented by one, exactly -
>
> Sorry for self-reply!
> Of course if you have a *very* big number, that might mean it's the
> same.... sometimes I do faster typing than thinking... :)
>
Exactly -- that's the trap.
Also it's not reversible.
x++;
x--;
changes the value of x in many cases:
Old x New x
real.max real.infinity // overflow
1.2345678e-10 1.2e-10 // loss of precision
1e-50 0 // catastrophic cancellation
More information about the Digitalmars-d
mailing list