Changes between Version 1 and Version 2 of Ticket #658, comment 7
- Timestamp:
- Jan 26, 2015, 9:21:59 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #658, comment 7
v1 v2 5 5 * so integer division by zero sets 0, floating point corresponds to IEEE 754 which results in +/- inf or nan, for which we don't need to care as C++ implements it already 6 6 * it's similar in Matlab, except Matlab automatically converts to float on integer division and correspondingly returns inf/nan 7 * similar in R as far as I could see 7 8 * From wikipedia on [http://en.wikipedia.org/wiki/Division_by_zero#In_computer_arithmetic integer division]: 8 9 > Integer division by zero is usually handled differently from floating point since there is no integer representation for the result. Some processors generate an exception when an attempt is made to divide an integer by zero, although others will simply continue and generate an incorrect result for the division. The result depends on how division is implemented, and can either be zero, or sometimes the largest possible integer.