[ieeefp-tests-devel] Re: [ieeefp-tests-cvs] CVS update: ieeefp-tests/ieeefp-tests.lisp
Christophe Rhodes
csr21 at cam.ac.uk
Tue Jun 15 22:50:02 UTC 2004
Raymond Toy <rtoy at common-lisp.net> writes:
> o Add support for hypot. This is used to test Lisp's ABS function on
> complex values.
Cool. I have ucblib-style input files for trunc()/FTRUNCATE in single
and double precision. Do you think they should go into ucb/ucblib/,
or should we treat that as pristine and place additions somewhere
else?
Having trunc(), we are most of the way towards getting input files for
rint(), which is basically ceil() in rounding mode p, floor() in
rounding mode m, trunc() in rounding mode z; it's only complicated in
rounding mode n.
There does remain a point for discussion, though: what Lisp function,
if any, corresponds to rint()? The natural choice would be FROUND,
but a case could be made for FROUND to be round-to-nearest always much
as FTRUNCATE is round-to-zero always.
Perhaps this allows me to bring up a couple of ideas for things which
should live in the IEEE754 package? Ideas:
* specialised condition types: IEEE754:DIVISION-BY-ZERO and
friends. The standard document says that it would be nice for
programs to be able to find the faulting instruction and the
operands from the handler; it would be nice to attempt to support
this, at least for the IEEE-specified operations (+, -, *, /, sqrt
and round-to-integer);
* functions to get at the individual bits in the fields:
IEEE:DOUBLE-FLOAT-EXPONENT and friends. (I'm aware that the
exponent field is biased; that makes design interesting)
* (maybe) implementations of functions which don't have any
corresponding analogue in CL: IEEE754:LOG10? IEEE754:HYPOT?
Maybe inspiration could be drawn from the C99 and C0X standards in
this regard.
Anything else?
Cheers,
Christophe
--
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)
More information about the Ieeefp-tests-devel
mailing list