3 ms·
Unlike what the author says, this is the total opposite to a practical/pragmatic solution. He does not prove that this is a useful representation, only that gi
by halflings 8y ago
Unlike what the author says, this is the total opposite to a practical/pragmatic solution.
He does not prove that this is a useful representation, only that given his own axioms, this can be considered mathematically correct.
Very practical issues with 1/0 == 0:
- This result is counter-intuitive, took building a custom fields and responding to the incredulity of all.
- The main reason this is counter-intuitive is not mentionned in the post: division is no longer monotonous.
1/0.5 = 2
1/0.25 = 4
1/0.0001 = 10000
1/0 = 0
This is calling for an Ariane 5-type crash because an underflow error caused a value to suddenly fall from 10e6 to 0.
- stringer 8y agoWere are speaking of integers here not FP numbers.
- curice 8y agoNot to be pedantic, but one of the author's own examples involves pi inverse, so I think discussing FP numbers is valid.
- stringer 8y agoYes I know, but in the context of Pony, 1/0==0 only applies to integers, not FP numbers. The article doesn't make it clear.
- spooneybarger 8y agofloating point numbers in Pony follow the standard and return Infinity for division by zero. integer division by zero is undefined behavior and something each programming language has to decide how to handle.
- halflings 8y agoThe article mentions floating point numbers as well, and the same applies to integers anyway. Only used FP numbers for emphasis.
- FlipperBucket 8y agoI think this is calling for a Pony programmer working with floating point to know how their own basic operators function. Wrapping division in a function that checks for zero will give you the proper result you would like to return.
- lmm 8y agoAh yes, the wobbly-step school of language design.
- klodolph 8y ago> This is calling for an Ariane 5-type crash because an underflow error caused a value to suddenly fall from 10e6 to 0. That’s the opposite of what happened. A value overflowed, which triggered an exception, which caused a module to emit diagnostic information, which was misinterpreted by other systems as flight data. Interestingly, the value which overflowed was part of a system which was only used until LT+7, which had aleady passed… In short, if the overflow had simply saturated or wrapped around to 0 or given some other garbage result, the Ariane would have not crashed.