[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Numerical example (real? -2.5+0.0i)
Andre van Tonder writes:
> On Mon, 15 Aug 2011, Jussi Piitulainen wrote:
>
> > An example in July draft 6.2.5 shows (real? -2.5+0.0i) as #t. The text
> > above the examples says (real? z) if and only if (zero? (imag-part z))
> > and (exact? (imag-part z)). The imag-part is clearly not exact.
>
> Just off the cuff I thought fully known concrete finite-recision reals
> such as 0.0 were exact. How is it not? There is no uncertainty (no
> hashes indicated), so it is mathematically equal to an exact rational
> number.
6.2.4 Syntax of numerical constants, latter half of third para:
If the written representation of a number has no exactness prefix,
... [the constant] is inexact if it _contains a decimal point_, an
exponent, or a "#" character in the place of a digit [my emphasis]
For what it's worth:
guile> (exact? 0.0)
#f
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports