2 ms·
Further nit: > The calculation was using the HUGE_VAL constant, which is defined as an ISO C constant with a value of positive infinity [...]. Only if the flo
by mananaysiempre 5y ago
Further nit:
> The calculation was using the HUGE_VAL constant, which is defined as an ISO C constant with a value of positive infinity [...].
Only if the floating point implementation has infinities, which ISO C does not require. C99 also defines INFINITY, but that one’s also not required to actually be an infinity, unfortunately.
More seriously:
> "Nowadays, outside museums, it's hard to find computers which don't implement IEEE 754."
AFAIU there are plenty of implementations that either run faster without or outright refuse to implement the “gradual underflow” semantics, which 754 technically requires with no equivocation. (Wikipedia tells me the Intel compiler turns on SSE “denormals as zeros” when optimizations are on, for example.)