[r6rs-discuss] possible implementation of true 0 & Inf within ieee 754 using signaling NaN's?

From: Paul Schlie <schlie>
Date: Sun Oct 8 13:29:51 2006

as signaling NaN's may be utilized to effectively overload ieee default
behavior within scheme implementations on platforms supporting signaling
NaN exceptions; might it be worth while considering further defining an
exact 0 and it's corresponding reciprocal Inf as distinct signaling NaN's
thereby 0.0 (or ~0.0) may be designated as the counter part to integer 0,
thereby an implementation may enforce via traps appropriate return values
upon their use without otherwise unnecessarily slowing down computation,
whereby then:

(fl= -0.0 0.0 +0.0) => #t
(fl< -0.0 0.0 +0.0) => #t

(map fl/ '(-0.0 0.0 +0.0)) => (-inf.0 inf.0 +inf.0)

---
or alternatively, designate -0.0 and +0.0 as being equivalent to smallest
correspondingly signed sub-normal values, and 0.0 as being true 0; thereby
(/ 0.0) may be trapped without needing to define new a new sNaN value;
(fl= -0.0 0.0 +0.0) => #f
(fl< -0.0 0.0 +0.0) => #t
(map fl/ '(-0.0 0.0 +0.0)) => (-inf.0 inf.0 +inf.0)
---
as just a thought of what could be done leveraging the ieee 754 exception
mechanism supported by most modern platforms (albeit infrequently used).
Received on Sun Oct 08 2006 - 13:29:14 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC