craftinginterpreters icon indicating copy to clipboard operation
craftinginterpreters copied to clipboard

update guidance around division by zero

Open jeremyhuiskamp opened this issue 2 years ago • 0 comments

Ruby doesn't throw an exception when dividing by 0.0, which is the equivalent to dividing by 0 in Lox. Rather, it does the same thing as java (and javascript, and IEEE754) in returning Infinity/-Infinity/NaN. Python seems to be the outlier here.

Tested on ruby 2.6 and 3.2.2.

jeremyhuiskamp avatar Jan 11 '24 22:01 jeremyhuiskamp