double division by zero inconsistency

Description

Division by zero with doubles will throw an exception if both arguments are boxed, but not otherwise:

Environment

None

Activity

Show:
Erik Assum
September 29, 2017, 5:10 AM

So, I guess some division by zero is somewhat undefined.
If one removes

then

returns infinity as the unboxed versions.

Although doing so, also causes a change to

which then becomes `1/0`, whereas it previously threw Divide by zero.

From Numbers.java we see that unboxed math does not protect against division by zero:

whereas boxed versions do:

This inconsistency is also reproducible with clojure 1.8:

Erik Assum
October 5, 2017, 5:43 AM

Any thoughts on an approach?
Both throwing on division by zero for natives and allowing it for boxed seems to be a serious change, and the tests expects an exception for boxed division by zero.

Assignee

Unassigned

Reporter

Greg Chapman

Labels

Approval

Triaged

Patch

None

Affects versions

Priority

Minor