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

Re: arithmetic issues

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.



   Date: Mon, 24 Oct 2005 04:27:08 +0200
   From: Marcin 'Qrczak' Kowalczyk <qrczak@xxxxxxxxxx>

   Taylor Campbell <campbell@xxxxxxxxxx> writes:

   > this is typically what is done with exact arithmetic, such as in
   > Scheme48:
   >
   > (/ 0 0)     => Error: rational division by zero

   Of course; because in the case of exact arithmetic the problem
   definitely means that the function is undefined at this point.
   With inexact arithmetic it might just result from rounding errors,
   so a computation can't expect it in advance, thus it's not generally
   a symptom of a bug.

Conditions do not imply bugs.  They are just that: conditions.  How
they are detected is a matter unrelated to their fundamental purpose.
NaN is a condition, just like the end of an input stream; it's not an
actual numerical value, though it is produced as a result of IEEE 754
numerical operations, just as an EOF object is not any element of an
input stream but is produced by procedures that read from them; and
neither necessarily implies a bug in a program.