PS: This is the approach PHP took in the early days too.
PS: This is the approach PHP took in the early days too.
For a recent discussion about this on the Isabelle mailing list, see here https://lists.cam.ac.uk/pipermail/cl-isabelle-users/2018-Mar... (search for 1/0)
>>> 0.3 * 3.0
0.8999999999999999
There's are a lot of areas of computer science that touch on these sorts of problems. And people love to do Wat! talks for all those fun edge cases where how computers work and how programming languages work run up against our expectations of what we expect to be correct.
Throwing an error is actually “wrong” as the result should actually be undefined/null but most languages throw for practical reasons.
So in fact it’s most languages that are being “wrong but functional”. Pony is just functioning differently.
If it’s raised and documented well there’s no reason it wouldn’t work as undefined (could throw type errors on usage after that for example).
Well, it can be argued that physics dictates an error is intrinsically better than 0, and that programs care about physics at least as much as about mathematics.