Troupe icon indicating copy to clipboard operation
Troupe copied to clipboard

Division by zero results in 'Infinity' or 'NaN' value

Open mkarup opened this issue 1 year ago • 1 comments

I'm not sure whether this is the intended semantics (side effect of using javascript?), but dividing a non-zero number by zero results in (+/-) Infinity

1/0

gives

>>> Main thread finished with value: Infinity@{}%{}

Similarly, dividing zero by zero results in a NaN value:

0/0

gives

>>> Main thread finished with value: NaN@{}%{}

The Infinity / NaN are also propagated when they are used in arithmetic operations with other values.

mkarup avatar Feb 03 '25 10:02 mkarup

Thanks. This is a bug. We should insert zero checks for division in the IR2Raw.

aslanix avatar Feb 03 '25 10:02 aslanix

Fixed in 0a823d3c0d8698cbdf4aaa036fafaca2115a2c1c

aslanix avatar Jun 23 '25 20:06 aslanix