On Fri, Jul 28, 2000 at 03:30:45PM +0200, Bruno Haible wrote:
> Knut Arild Erstad writes:
>
> > I understand the argument, but it still seemed unintuitive somehow, and
> > different from all other languages and Lisp versions I remember seeing
>
> But it is closer to what a real computer algebra system does. Because
> it is closer to the true mathematical result.
That I can agree with. But it was certainly an unexpected result for me,
and I still think it is a violation of the standard...
> > <URL:http://www.xanalys.com/software_tools/reference/HyperSpec/Body/
> > sec_12-1-4-4.html>
>
> This section applies only to float-float combinations. Look at section
> 12.1.4.1 and at section 12.1.3.3:
>
> "When the arguments to an irrational mathematical function are all
> rational and the true mathematical result is also (mathematically)
> rational, then unless otherwise noted an implementation is free to
> return either an accurate rational result or a single float
> approximation."
"When the arguments to an irrational mathematic functions are *all*
rational" ... this does not apply to (* 0 1.1). From what I can see it
applies only to the functions listed in that section, and only if all
arguments are rational, so that (expt 0 1.1) must return 0.0, and
(log 1 2.0) must return 0.0, for instance. clisp returns 0 in the second
case, BTW.
Section 12.1.4.1 says
"When rationals and floats are combined by a numerical function, *the
rational is first converted to a float* of the same format. For functions
such as + that take more than two arguments, it is permitted that *part*
of the operation be carried out exactly using rationals and the rest be
done using floating-point arithmetic."
It seems pretty clear to me: a numerical function with one or more float
arguments always returns a float (or in some cases a complex number with
float parts). Am I missing something?
--
Knut Arild Erstad
Vacuums are nothings.
We only mention them to let them know we know they're there.
|