On Jan 9, 2017, at 17:16 , Raymond Toy <toy.raymond@gmail.com> wrote:
"Marco" == Marco Antoniotti <marcoxa@cs.nyu.edu> writes:
Marco> Hi Ray Marco> maybe we can just have this discussion here.
Marco> I am not a person who knows all that much about the IEEE fine details, but I would like to have a “higher level” portable API to access IEEE NaNs, infinities, and rounding modes. I am kind of familiar with the C99 API.
Marco> Would you like to have an API consisting of something like (given a package “M”, not its real name) the following? Assuming all “quiet” NaNs.
Marco> Parameter NaN
Marco> Constant <float-length>-float-positive-infinity Marco> Constant <float-length>-float-negative-infinity
Marco> Type rounding-mode (member :positive :negative :toward-zero :to-nearest)
Marco> Struct floating-point-configuration
What does that mean?
Marco> Function current-floating-point-configuration Marco> Function (setf current-floating-point-configuration)
Marco> Macro with-floating-point-configuration
Marco> Function current-rounding-mode Marco> Function (setf current-rounding-mode)
Marco> Macro with-rounding-mode
Coincidentally, I was looking at ieeefp-tests (https://gitlab.common-lisp.net/ieeefp-tests/ieeefp-tests) last night. It might satisfy your needs because it provides at least some of the things you're looking for. And it looks like it abcl, cmucl, and sbcl. Not bad.
Thanks for the pointer to IEEEFP-TESTS.
I'm curious, though. Can you explain your use case for having such an interface?
Well. I have been fooling around (read: veered off a tangent) with interval arithmetic, where it looks like you need to ensure that your rounding modes are set to positive or negative infinity when using an end points representation. That’s were it all started. Next I am always for defining compatible layers whenever possible. Which is the other bit of my idiosyncrasies. After all, I am one of the most prolific (YMMV) CDR producer :) Cheers Marco
-- Ray
_______________________________________________ cmucl-imp mailing list cmucl-imp@lists.zs64.net https://lists.zs64.net/mailman/listinfo/cmucl-imp
-- Marco Antoniotti