Fun with floating point

Kenny via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 8 01:05:30 PST 2015


> nope, this is a bug in your code. compiler (by the specs) is 
> free to
> perform intermediate calculations with any precision that is 
> not lower
> than a highest used type (i.e. not lower that `float`'s one for 
> `while`
> condition (`f + eps != f`). it may be even infinite precision, 
> so your
> code may not exit the loop at all.

Thanks, it's clear now. I still have one question in the above 
post, I would appreciate if you check it too.



More information about the Digitalmars-d-learn mailing list