[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.

Taylor Campbell <campbell@xxxxxxxxxx> writes:

> But NaN conditions can be signalled like error conditions can be;

When the INVALID exception is signalled, there is nothing to print.
The issue of printing and reading NaNs arises only when the exception
is not signalled and the operation yields a NaN instead, which is the
default in IEEE.

> 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.

   __("<         Marcin Kowalczyk
   \__/       qrczak@xxxxxxxxxx
    ^^     http://qrnik.knm.org.pl/~qrczak/