Live data from Hacker News

Two Case Studies of NaN

sebsite.pw

1–10 of 19 posts

Re: Two Case Studies of NaN

#2
Just store what you mean to store for gods sake. We have been fighting with over-designed bs for decades.

Zero is not absence of a value. It has a value, it happens to be 0. Same for undefined/infinity. They exist.

Let the hardware engineers figure out an efficient way to deal with it. If it costs more, well if we add up all of the costs of bugs due to zero/null conversions, maybe it was worth it.

Re: Two Case Studies of NaN

#3

Just store what you mean to store for gods sake. We have been fighting with over-designed bs for decades. Zero is not absence of a value. It has a value, it happens to be 0. Same for undefined/infinity. They exist. Let the hardware engineers figure out an efficient way to deal with it. If it costs more, well if we add up all of the costs of bugs due to zero/null conversions, maybe it was worth it.

This article is not about null but about NaN, a special case floating-point value which is the result of diving by zero.

Re: Two Case Studies of NaN

#7
post #3

Just store what you mean to store for gods sake. We have been fighting with over-designed bs for decades. Zero is not absence of a value. It has a value, it happens to be 0. Same for undefined/infinity. They exist. Let the hardware engineers figure out an efficient way to deal with it. If it costs more, well if we add up all of the costs of bugs due to zero/null conversions, maybe it was worth it.

This article is not about null but about NaN, a special case floating-point value which is the result of diving by zero.

Specifically, 0/0 (or inf/inf), not any division by 0.

Re: Two Case Studies of NaN

#8
post #6
post #4

Wat. I wish there were a recent remake of it.

Of what, IEEE-754? Given how poorly most languages implement it (and how many shortcuts are taken in the same of speed), I'm not sure IEEE-754 is the problem.

Other than the IEE-754 he might mean the Wat talk [1] by Gary Bernhardt which is kind of famous for poking fun at JavaScript (and it's unpredictability with things like NaN. As a JS developer myself I find it hilarious.) Though I don't know why it would need to be remade he at least referenced the talk, it seems, with the word Wat, so it's worth mentioning at least I guess

[1]: https://www.destroyallsoftware.com/talks/wat

Re: Two Case Studies of NaN

#9
post #7
post #3

Earlier quoted context omitted.

This article is not about null but about NaN, a special case floating-point value which is the result of diving by zero.

Specifically, 0/0 (or inf/inf), not any division by 0.

0 x inf is also NaN. It's not just division.

Re: Two Case Studies of NaN

#10
post #6
post #4

Wat. I wish there were a recent remake of it.

Of what, IEEE-754? Given how poorly most languages implement it (and how many shortcuts are taken in the same of speed), I'm not sure IEEE-754 is the problem.

I believe the other poster is correct, that OP is referencing the video "Wat" (https://www.destroyallsoftware.com/talks/wat), but I think that if most implementations of a standard are poor, the standard is probably the problem. It's likely to be either unclear or too complicated.
Post reply on HN