Bug #579
open
Divide by 0 error incorrectly returns NaN. Instead, it should return a divide by 0 error so On Error will work.
Added by Brian Flanagan about 4 years ago.
Updated over 2 years ago.
Description
It should, instead, cause a runtime error, with a proper divide by 0 error displayed.
- Priority changed from Normal to High
- Status changed from New to Feedback
- Assignee set to Francois Lionet
- Priority changed from High to Normal
- Target version set to Beta 1
I cannot make it crash... "Infinity" IS a number in Javascript. Please provide an example of source code that does it so that I can prevent it from crashing.
It is impossible to detect division by zero in a simple manner, implementing a protection would slow down every expression.
I don't understand what is complex about determining if the divisor is 0.
Sample code:
X=5/0
Print X
result:
NaN
- Subject changed from Divide by 0 error incorrectly returns a STRING " Infinity"... which causes a NaN error. to Divide by 0 error incorrectly returns NaN. Instead, it should return a divide by 0 error so On Error will work.
- Target version deleted (
Beta 1)
- Affected version changed from Beta 1 to 1.0.0 (B15)
The problem is that this should return a proper ERRN and ERR$.
This is required for On Error or other error handling to work properly.
Also available in: Atom
PDF