Menu

#22 boolean of complex number

Lisp
open
nobody
Defect (22)
5
2009-02-13
2009-02-13
No

The
lisp boolean function's(for a complex number) correct behavior is to return true if the real or
imaginary value is non-zero. It should only return false if both the real and imaginary values are zero.
Recreate: Run the following lines:
(writeln (boolean #c0.0-0.0i))
(writeln (boolean #c0.0+0.0i))
(writeln (boolean #c0.0+1.0i))
(writeln (boolean #c1.0-1.0i))
(writeln (boolean #c3.0+0.0i))
(writeln (boolean #c1.0))
(writeln (boolean #c3.0))
The first and second lines should return false and everything else should return true.

Discussion


Log in to post a comment.