Editions Ideas
monkyyy
crazymonkyyy at gmail.com
Sun Dec 14 16:44:35 UTC 2025
On Sunday, 14 December 2025 at 13:43:55 UTC, Dom Disc wrote:
> On Sunday, 14 December 2025 at 13:27:19 UTC, Dom Disc wrote:
>> NaN > 0 is false and NaN <= 0 is also false.
>> One can see this as a contradiction, but it isn't.
>> So why can not also NaN == 0 and NaN != 0 both be false?
>> I would consider this IEEE754 compliant.
>
> I mean, the rule is really easy: Simply any comparison
> involving NaN should result in false. Only the result of the
> comparison can be further processed as boolean expression.
>
> Consider this:
>
> ```d
> if(a!=a) { /*kill your harddisk*/ }
> ```
>
> Would you expect this code to ever be executed?
>
> But if you set float a = NaN, then it will!
> We should avoid this.
When they say they are ieeeeeeee floats they are definition is
that wild stupidity, specs are just written by people and
sometimes those people were idiots 60 years ago.
Hense why Im anti spec, specs are in practice where hard to fix
bugs get defined as correct *in authoritative lawyeristic
verbosity* in the wrong section. This float behavior belongs with
a number trait or by the opoverloads with no implied authorithy
its correct or desired. Its a bug in the hardware and the
hardwares spec it be quite hard to fix by a compiler.
More information about the Digitalmars-d
mailing list