[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Raising negative numbers to an inexact integer
From: |
Andy Wingo |
Subject: |
Re: Raising negative numbers to an inexact integer |
Date: |
Wed, 02 Feb 2011 21:16:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
On Mon 31 Jan 2011 21:26, Mark H Weaver <address@hidden> writes:
> For example, although (expt -1.0 2) yields 1.0, (expt -1 2.0) yields
> 1.0+0.0i, which is not `real?' according to the R6RS. The R6RS requires
> that `real?' return #t only if the imaginary part is an _exact_ 0.
>
> Note that operations requiring reals, including the comparison operators
> `<', '>', '<=' and '>=' will raise an exception if applied to these
> numbers. However, I made sure that `inexact->exact' would ignore an
> inexact zero imaginary part.
>
> I don't expect this to be a problem, since anyone raising a negative
> number to an inexact power should expect that the result may not be
> real.
>
> What do you think?
Sounds sane to me.
Andy
--
http://wingolog.org/