fix for the logic in two-argument '='
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
(sorry about the terseness, but i spent fifteen minutes writing a nice bug report only to have the site discard it as a stale page...)
i attach a patch to 1.2.14 which corrects the logic in the two argument equals to properly compare unity rationals with integers.
with the patch
$ sbcl
This is SBCL 1.2.14.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (defun make-rational (num den)
(sb-kernel:
MAKE-RATIONAL
* (= (make-rational 0 1) 0)
T
* (ceiling (make-rational 49 1) )
49
0/1
otherwise the result is one off.
the same is likely for other math operators as they depend on a test for '0' which fails with for the remainder result from truncate.
That's not a legal ratio.