Re:Ask HN: What should an undefined variable evaluate to?
by carlosneves on Sunday September 22, 2024 @08:42PM
(#41621362)
There seems to be a trade-off between letting the program run and halting it with an error in these cases. Sometimes letting it keep going is useful, sometimes not.
But overall, having dedicated "error modes" seems to be the preferred route.
Thanks for the reply!
I wasn't aware of the VAX series of computers, successors of the PDPs. I knew Unix was first written on a PDP-11. Also wasn't aware of the hardware requirements for floating points.
In the IEEE 754 floating point definition, there are specific values for errors: mathematically undefined, division by zero, overflow, underflow, and inexact. These MUST be implemented in hardware to meet the specification.