Changes between Version 1 and Version 2 of Ticket #658, comment 7


Ignore:
Timestamp:
Jan 26, 2015, 9:21:59 AM (10 years ago)
Author:
Dimitar Misev

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #658, comment 7

    v1 v2  
    55 * 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
    66 * 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
    78* From wikipedia on [http://en.wikipedia.org/wiki/Division_by_zero#In_computer_arithmetic integer division]:
    89 > 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.