Movement against float.init being nan

IGotD- nise at nise.com
Sat Aug 20 18:59:40 UTC 2022


On Saturday, 20 August 2022 at 13:06:49 UTC, Nick Treleaven wrote:
>
> Thanks. The above is infinity though.
>
> 	f = 1.0;
> 	f /= 0;
> 	assert(f is f.infinity);
>
> This produces a different NaN:
>
> 	float f = 0;
> 	f /= 0;
> 	assert(f is f.nan); //fails

I never understood why the IEEE standard decided to include 
infinity. What were they trying to achieve? Indeterminate maths 
with floating point?


More information about the Digitalmars-d mailing list