Project

General

Profile

Actions

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.

Status:
Feedback
Priority:
Normal
Target version:
-
Start date:
11/17/2020
Due date:
% Done:

0%

Estimated time:
1:00 h
Affected version:

Description

It should, instead, cause a runtime error, with a proper divide by 0 error displayed.

Actions #1

Updated by Brian Flanagan about 4 years ago

  • Priority changed from Normal to High
Actions #2

Updated by Francois Lionet about 4 years ago

  • 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.

Actions #3

Updated by Brian Flanagan about 4 years ago

I don't understand what is complex about determining if the divisor is 0.

Sample code:

X=5/0
Print X

result:

NaN

Actions #4

Updated by Brian Flanagan over 2 years ago

  • 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.

Actions

Also available in: Atom PDF