[Top][All Lists]

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

Re: generic * and 0

From: Mikael Djurfeldt
Subject: Re: generic * and 0
Date: Mon, 4 Dec 2006 19:26:12 +0100

2006/12/4, Kevin Ryde <address@hidden>:
While nosing around nearby stuff I noticed

        (* 0 1.0)  => 0
        (* 0 1+1i) => 0
        (* 1.0  0) => 0.0
        (* 1+1i 0) => 0.0

which seems a bit inconsistent.


 R5RS "Exactness" reads like either
exact or inexact is permitted, but I imagine it ought to be the same
whichever way around you write the args.  I think I'll change the
latter two to exact 0.

Good idea.  Because of paragraph 6.2.2, a program cannot expect to get
the result 0.0, and it seems like a strength of the implementation to
provide the additional piece of information that the result is indeed
*exactly* 0.

An added bonus is that it doesn't break the idea to have a common
abstract zero for the * operator.  (Not entirely sure that the common
zero is a good idea, but I tend to think so.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]