Skip to content

update guidance around division by zero#1153

Open
jeremyhuiskamp wants to merge 1 commit intomunificent:masterfrom
jeremyhuiskamp:patch-1
Open

update guidance around division by zero#1153
jeremyhuiskamp wants to merge 1 commit intomunificent:masterfrom
jeremyhuiskamp:patch-1

Conversation

@jeremyhuiskamp
Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant