Email list hosting service & mailing list manager

arithmetic issues Aubrey Jaffer (21 Oct 2005 14:53 UTC)
Re: arithmetic issues John.Cowan (21 Oct 2005 15:59 UTC)
Re: arithmetic issues bear (21 Oct 2005 16:39 UTC)
Re: arithmetic issues Aubrey Jaffer (22 Oct 2005 01:17 UTC)
Re: arithmetic issues John.Cowan (22 Oct 2005 02:03 UTC)
(missing)
(missing)
Re: +nan.0 problems bear (24 Oct 2005 06:04 UTC)
(missing)
(missing)
(missing)
(missing)
(missing)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (23 Oct 2005 20:24 UTC)
Re: arithmetic issues Thomas Bushnell BSG (23 Oct 2005 20:30 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (23 Oct 2005 22:25 UTC)
Re: arithmetic issues Thomas Bushnell BSG (23 Oct 2005 22:30 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (21 Oct 2005 17:15 UTC)
Re: arithmetic issues Taylor Campbell (21 Oct 2005 20:24 UTC)
Re: arithmetic issues Thomas Bushnell BSG (21 Oct 2005 20:32 UTC)
Re: arithmetic issues Alan Watson (22 Oct 2005 00:26 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (22 Oct 2005 00:45 UTC)
Re: arithmetic issues Thomas Bushnell BSG (22 Oct 2005 01:22 UTC)
(missing)
(missing)
(missing)
(missing)
Re: arithmetic issues Bradley Lucier (23 Oct 2005 19:46 UTC)
Re: arithmetic issues Aubrey Jaffer (23 Oct 2005 20:10 UTC)
Re: arithmetic issues Aubrey Jaffer (23 Oct 2005 19:54 UTC)
Re: arithmetic issues Jens Axel Søgaard (23 Oct 2005 20:01 UTC)
Re: arithmetic issues Aubrey Jaffer (23 Oct 2005 20:50 UTC)
Re: arithmetic issues Thomas Bushnell BSG (23 Oct 2005 21:12 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (23 Oct 2005 22:31 UTC)
Re: arithmetic issues Thomas Bushnell BSG (23 Oct 2005 22:33 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (23 Oct 2005 22:50 UTC)
Re: arithmetic issues Thomas Bushnell BSG (23 Oct 2005 22:57 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (24 Oct 2005 00:53 UTC)
Re: arithmetic issues Thomas Bushnell BSG (24 Oct 2005 01:05 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (24 Oct 2005 01:45 UTC)
Re: arithmetic issues Taylor Campbell (24 Oct 2005 02:00 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (24 Oct 2005 02:08 UTC)
Re: arithmetic issues Taylor Campbell (24 Oct 2005 02:14 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (24 Oct 2005 02:27 UTC)
Re: arithmetic issues Taylor Campbell (24 Oct 2005 02:45 UTC)
Re: arithmetic issues Alan Watson (24 Oct 2005 02:13 UTC)
Re: arithmetic issues Taylor Campbell (24 Oct 2005 02:22 UTC)
Re: arithmetic issues Alan Watson (24 Oct 2005 03:19 UTC)
Re: arithmetic issues Thomas Bushnell BSG (24 Oct 2005 02:01 UTC)
Re: arithmetic issues Aubrey Jaffer (24 Oct 2005 02:27 UTC)
Re: arithmetic issues Alan Watson (24 Oct 2005 03:14 UTC)
Re: arithmetic issues John.Cowan (24 Oct 2005 05:37 UTC)
Re: arithmetic issues Per Bothner (24 Oct 2005 07:05 UTC)
Re: arithmetic issues Marcin 'Qrczak' Kowalczyk (24 Oct 2005 07:58 UTC)
Re: arithmetic issues Thomas Bushnell BSG (24 Oct 2005 08:05 UTC)
Re: arithmetic issues Alan Watson (24 Oct 2005 08:25 UTC)
reading NaNs Aubrey Jaffer (24 Oct 2005 15:35 UTC)
Re: reading NaNs Per Bothner (24 Oct 2005 17:35 UTC)
Re: reading NaNs bear (24 Oct 2005 19:23 UTC)
Re: reading NaNs Marcin 'Qrczak' Kowalczyk (24 Oct 2005 18:17 UTC)
Re: arithmetic issues bear (24 Oct 2005 06:13 UTC)
Re: arithmetic issues Taylor Campbell (24 Oct 2005 06:27 UTC)
Re: arithmetic issues Thomas Bushnell BSG (24 Oct 2005 07:49 UTC)
Re: arithmetic issues bear (24 Oct 2005 16:41 UTC)
Re: arithmetic issues Thomas Bushnell BSG (24 Oct 2005 07:49 UTC)

Re: arithmetic issues Marcin 'Qrczak' Kowalczyk 21 Oct 2005 17:15 UTC

Aubrey Jaffer <xxxxxx@alum.mit.edu> writes:

> Being error objects, syntax for NaNs should be unspecified.

I disagree.

Note that supporting special values (+inf.0, -inf.0, +nan.0, -0.0)
needs at least functions to recognize them, in particular finite?
(to go a fast path for non-pathological cases) and either negative-zero?
or sign-bit? (the latter answering "positive" for 0.0 and "negative" for
-0.0). Recognizing NaN is more clear with a distinguished predicate than
with (= x x).

> None of the examples in SRFI-77 return -0.0 unless they are passed
> -0.0 as an argument.  Does -0.0 result only from a literal -0.0
> constant?

For example (- 0.0), (/ -inf.0) and -1e-2000 yield -0.0,
(* 0.0-i 0.0-i) yields (-1.0-0.0i).

> In an implementation with -0.0, what is the result of (* -5.0 0.0)?

-0.0

> -0.0 is insufficiently specified by SRFI-77; it will be a portability
> killer.

The relevant IEEE standard that everybody uses specifies it.
Most processors support it natively.

> Mathematically, mixed exactness complex numbers makes no sense.

Not true. For example 1.23 is a real number for sure, but its value
could have been rounded. 1.23+0.0i and 1.23-0.0i signify that the true
value might not be real.

1.23+0i can be unified with 1.23 just like 123/1 is unified with 123.

> The procedures REAL-PART, IMAG-PART, and MAKE-RECTANGULAR already
> guarantee that the orthogonal representation is available.  The
> language should not constrain an internal representation which is
> transparent to the user.

It's not transparent anyway if real-part and imag-part are reqired to
return former arguments of make-rectangular (as long as they are real
numbers) in the sense of eqv? or at least =. No implementation uses a
different representation anyway, so constraining is theoretical.

C++ made the mistake of not specifying the layout of complex numbers
and having re() and im() as methods instead of fields. Every
implementation does the same anyway, and not specifying this makes
harder to interface to other languages.

>  | * Should `(floor +inf.0)' return +inf.0 or signal an error
>  |   instead?  (Similarly for ceiling, flfloor, infloor, etc.)
>
> Floor is specified to return an integer.  +inf.0 is not an integer.
> Thus it is an error.

IMHO it's more useful to return +inf.0, because then the program
doesn't have to treat the possibility of overflow at this point yet.
IEEE, processors, and other languages which return an inexact number
here, all return +inf.0 I think.

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