1. Not sure if this is intended or not, but comparing two (quiet) NaN using "=" throws floating-point-invalid-operation; I would expect the result to be NIL, based on IEEE-754.
I am in a Yak shaving process: I was using the IEEE-FLOATS library and noticed that SBCL defines custom floating-point operations in SB-EXT; I generated a NaN with MAKE-SINGLE-FLOAT and wanted to see what Slime's fancy inspector would do with that value. An exception occurred instead, which leads me to send a pull request (see commit https://github.com/slime/slime/commit/925dd2d85e6f0aadee78c9c08b51991bad8b12ca).
Now, I am wondering if this is really necessary: shouldn't TWO-ARG-= simply returns NIL when given two NaNs?
1. Not sure if this is intended or not, but comparing two (quiet) NaN using "=" throws floating- point-invalid- operation; I would expect the result to be NIL, based on IEEE-754.
2. (= (sb-kernel: make-single- float #x7FFFFFFF) (sb-kernel: make-single- float #x7FFFFFFF)) POINT-INVALID- OPERATION {1006900C03}>.
; Evaluation aborted on #<FLOATING-
3. sbcl --version 7.master. 75-b464cda
SBCL 1.3.13.
4. *FEATURES*
(:EOS ALEXANDRIA. 0.DEV:: SEQUENCE- EMPTYP :SWANK :QUICKLISP SOCKETS- ADDRINFO :ASDF-PACKAGE- SYSTEM :ASDF3.1 :ASDF3 :ASDF2 :ASDF CHARS-EXIST- P :ASDF-UNICODE :64-BIT :64-BIT-REGISTERS IS-CONTROL- STACK INSTANCE- HEADER :COMPARE- AND-SWAP- VOPS FLOAT-VOPS :CYCLE-COUNTER :ELF :FLOAT-EQL-VOPS PC-STANDARD- SAVE :GENCGC :IEEE-FLOATING- POINT :IMMOBILE-CODE BARRIER- VOPS :MULTIPLY-HIGH-VOPS BLKSIZE- T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN GETPROTOBY- R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC SUSECONDS- T :PACKAGE- LOCAL-NICKNAMES :PRECISE- ARG-COUNT- ERROR INIT-VOPS :RAW-SIGNED-WORD :SB-AFTER-XC-CORE COMPRESSION :SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS LOCATIONS :SB-TEST :SB-THREAD :SB-UNICODE FOR-INTERNALS :SBCL :STACK- ALLOCATABLE- CLOSURES ALLOCATABLE- FIXED-OBJECTS :STACK- ALLOCATABLE- LISTS ALLOCATABLE- VECTORS :STACK- GROWS-DOWNWARD- NOT-UPWARD :SYMBOL-INFO-VOPS TO-FRAME- AND-CALL- VOP :X86-64)
:SB-BSD-
:OS-UNIX :NON-BASE-
:ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :C-STACK-
:COMMON-LISP :COMPACT-
:COMPLEX-
:FP-AND-
:IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
:LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-CORE-
:SB-SIMD-PACK :SB-SOURCE-
:SB-XREF-
:STACK-
:STACK-
:UNBIND-N-VOP :UNIX :UNWIND-
-----
I am in a Yak shaving process: I was using the IEEE-FLOATS library and noticed that SBCL defines custom floating-point operations in SB-EXT; I generated a NaN with MAKE-SINGLE-FLOAT and wanted to see what Slime's fancy inspector would do with that value. An exception occurred instead, which leads me to send a pull request (see commit https:/ /github. com/slime/ slime/commit/ 925dd2d85e6f0aa dee78c9c08b5199 1bad8b12ca).
Now, I am wondering if this is really necessary: shouldn't TWO-ARG-= simply returns NIL when given two NaNs?