[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange division using mixed integers and floats
From: |
Kevin Rodgers |
Subject: |
Re: Strange division using mixed integers and floats |
Date: |
Wed, 28 Apr 2004 09:59:22 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Andreas Schwab wrote:
> David Kastrup <address@hidden> writes:
>>Also (/ 5 4 2.3) would no longer be equivalent to (/ (/ 5 4) 2.3).
>
> I don't think it was ever documented as such. The Emacs Lisp manual
> only covers the case of all arguments being integers, but does not
> specifically say anything about mixed mode arguments, except that a
> floating point value is returned if any argument is floating. So
> always using floating point arithmetics in this case would fit the
> principle of least surprise.
The manual says:
| If there are additional arguments DIVISORS, then it divides DIVIDEND
| by each divisor in turn.
To me that means (/ 5 4 2.3) is equivalent to (/ (/ 5 4) 2.3).
--
Kevin Rodgers