[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FLOAT-SIGN and SIGNUM
- To: common-lisp at SU-AI
- Subject: FLOAT-SIGN and SIGNUM
- From: Guy.Steele at CMU-10A
- Date: Wed, 06 Oct 1982 14:29:00 -0000
Extending FLOAT-SIGN to two arguments is useful for the same reasons
as extending SIGNUM (though I'm not sure we really voted for the latter).
The handling of -0.0 is the crux, as Moon points out. I would assume that
(SIGNUM 0.0) => 0.0 (FLOAT-SIGN 0.0) => 1.0
(SIGNUM -0.0) => -0.0 (FLOAT-SIGN -0.0) => -1.0
(SIGNUM 0.0 x) => 0.0 (FLOAT-SIGN 0.0 x) => |x|
(SIGNUM -0.0 x) => -0.0 (FLOAT-SIGN -0.0 x) => -|x|
which are distinct useful behaviors, I think.