Raymond Toy rtoy@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