2 ms·
I agree that silent wraparound is evil. Overflow should trap (and throw an exception if the language has those). But I don't care for iNaN. I'd rather get th
by ScottBurson 15y ago
I agree that silent wraparound is evil. Overflow should trap (and throw an exception if the language has those).
But I don't care for iNaN. I'd rather get the exception at the point the problem was created.
I'm also not sure what I think about the idea that intermediate results should be able to be wider than the integer type being computed with. I'd rather be able to introduce temporaries for subexpressions without changing the meaning of the program -- this is basic referential transparency.
That said, I'm not completely convinced by the argument that it's too dangerous for a language to support arbitrary precision by default. Special types or operators can be used in contexts, like interrupt handlers, where allocation is undesirable. We have an existence proof that this is workable: the Lisp Machine operating system.