Re: SRFI-77 with more than one flonum representation
Alan Watson 03 Jul 2006 20:54 UTC
William D Clinger wrote:
> If I understand you correctly,
> you are asking for two operations that would round an arbitrary
> inexact real to single or double precision, respectively, with
> any underflow or overflow that accompanies the reduction in
> dynamic range, and returns the result as an inexact real of
> unspecified precision.
>
> I agree that it would be good to add those operations to SRFI 77.
> Did I state their semantics correctly?
Yes, except that I am not sure the the argument and result should be an
"arbitrary inexact real". Other options are "flonum", which would mesh
nicely with the efficient flonum part of SRFI 77, and "arbitrary real",
which would be yet more general. For me, "flonum" for the argument and
result would be most useful.
We need to be careful about single or double precision in this context
and how these are related to s-exponent and d-exponent literals. That
is, we need to make sure that it is clear that "round to single
precision" refers to the hardware's idea of single precision and not to
the Scheme's idea of the representation of s-exponent literals.
Regards,
Alan
--
Dr Alan Watson
Centro de Radioastronomía y Astrofísica
Universidad Astronómico Nacional de México