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

> The notion of 'fixnum' and 'flonum' is an implementation detail; it
> should really not be exposed to the user, as this simply shows a
> weakness in the expressiveness of the language.  What is needed,
> though, is a method of specifying modular or inexact arithmetic more
> precisely than the vague fixnum and flonum mechanism.  

This is why I sugggest that most users want some guaranteed
space-constant functions.  So we can provide them.  Not a problem. 

Space constant addition of integers, when overflow occurs, could
result in various things: modular "wraparond", special NaN values,
throwing errors, clamping to maxint.  All of those are sensible; there
is no clear reason why the modular wraparound is best; indeed, it is
usually worst.  This is why I suggest optional or default arguments to
such functions to specify this behavior.

The IEEE floating point experts can presumably explain what the right
options to provide are for space-constant operations on reals.