Open wwells opened 8 years ago
The documentation is correct, but maybe unclear. Integer addition produces runtime exceptions because integers don't have an infinite value. Floating point addition produces IEEE infinity. (I just tested it.) This was a policy choice and there could be others, which the DMG could decide to add as new functions (+' or something).
The choices for policy are:
The documentation that exists is correct but could be clarified (update the third digit of the version number). The DMG group might decide to add additional policies as new functions (update the second digit). The existing functions can't be changed witout a deprecation phase, and this change can't involve a deprecation phase because it doesn't involve a change to method signatures: users wouldn't be able to choose between the deprcated form and the new form unless there's some different syntax for each.
In the function library I see this in the description of "+" and some other functions: Details:
Float and double overflows do not produce runtime errors but result in positive or negative infinity, which would be carried through any subsequent calculations (see IEEE 754). Use impute.ensureFinite to produce errors from infinite or NaN values.
Runtime Errors:
So first it says that there are no runtime errors for overflow, then it says that there are. It would be good to decide on one of those. Or maybe there are only if impute.ensureFinite is used? How can one use it?