[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.

*To*: <srfi-77@xxxxxxxxxxxxxxxxx>*Subject*: (- 1.0 1.0) => 0 ; not +0.0 ?*From*: Paul Schlie <schlie@xxxxxxxxxxx>*Date*: Sat, 05 Nov 2005 21:56:17 -0500*Delivered-to*: srfi-77@xxxxxxxxxxxxxxxxx*Thread-index*: AcXifagp5q2rUE5wEdqtlgADk1ictA==*Thread-topic*: (- 1.0 1.0) => 0 ; not +0.0 ?*User-agent*: Microsoft-Entourage/11.2.1.051004

As a thought, I can't help wonder if it may be worth considering defining that the difference between equivalently valued inexacts is 0 not +0.0, as although one could argue that their difference may not be an exact 0, their difference is certainly not warranted to be positive; thereby avoiding the following very incorrect result: (/ (- 1.0e30 (+ 1.0e30 +1))) => +inf.0 ; vs. -1 correctly (/ (- 1.0e30 (+ 1.0e30 -1))) => +inf.0 ; vs. +1 correctly where the reciprocal of 0 is defined as being NaN, as opposed to generating an otherwise needless and useless error, thereby enabling an arguably less incorrect NaN result for the above. (correspondingly as -0.0 and +0.0 are more correctly thought of as being the negative and positive reciprocals of inf.0 respectively, the difference between equivalently signed 0.0's should be 0 as well, as their difference is certainly not correctly warranted to be positive either.) Thereby: (+ -0.0 -0.0) => -0.0 (+ +0.0 +0.0) => +0.0 (+ -0.0 +0.0) => 0 ; not +0.0 (+ -1.0 +1.0) => 0 ; not +0.0 (/ (- 1.0 1.0)) => NaN ; not +inf.0 etc.

- Prev by Date:
**Re: Testing the reference implementation** - Next by Date:
**Unifying the two generic arithmetic alternatives** - Previous by thread:
**Re: Error objects in general** - Next by thread:
**Unifying the two generic arithmetic alternatives** - Index(es):