Menu

#4978 mod(x, 0.0) raises a Lisp error while mod(x, 0) returns x

None
open
nobody
5
13 hours ago
13 hours ago
No

mod(5.0,0.0) signals a raw Lisp DIVISION-BY-ZERO, contradicting the documented mod(x,0) = x

Maxima 5.49post, SBCL 2.6.7.

(%i1) display2d:false$
(%i2) mod(5,0);
(%o2) 5
(%i3) mod(5.0,0.0);
Maxima encountered a Lisp error:
 arithmetic error DIVISION-BY-ZERO signalled
Operation was (/ 5.0 0.0).

Expected: (%i3) = 5.0, consistent with (%o2) and with the documented behaviour of mod at a zero modulus.

Discussion


Log in to post a comment.