--- Begin Message ---
Subject: |
flonum procedures returning non-flonum objects |
Date: |
Mon, 15 Jul 2013 15:38:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Hello schemers,
one property of the flonum procedures in r6rs is that they return
flonums. This should not happen:
scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (fllog -1.0)
$1 = 0.0+3.141592653589793i
scheme@(guile-user)> (flsqrt -1.0)
$2 = 0.0+1.0i
scheme@(guile-user)> (flasin 3.0)
$3 = 1.5707963267948966-1.762747174039086i
scheme@(guile-user)> (flacos 3.0)
$4 = 0.0+1.762747174039086i
scheme@(guile-user)> (flexpt -1.0 0.5)
$5 = 6.123031769111886e-17+1.0i
These results are not flonums. In r6rs-lib it says "the result may be a
NaN or some unspecified flonum." So returning +nan.0 would be better.
Tested with Guile 2.0.9.22-7e816-dirty.
Regards,
--
Göran Weinholt <address@hidden>
"Today's scientists have substituted mathematics for experiments, and they
wander
off through equation after equation, and eventually build a structure which has
no relation to reality." -- Nikola Tesla
pgp9L86nItxOh.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#14871: flonum procedures returning non-flonum objects |
Date: |
Tue, 16 Jul 2013 04:53:49 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Göran Weinholt <address@hidden> writes:
> one property of the flonum procedures in r6rs is that they return
> flonums. This should not happen:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (fllog -1.0)
> $1 = 0.0+3.141592653589793i
> scheme@(guile-user)> (flsqrt -1.0)
> $2 = 0.0+1.0i
> scheme@(guile-user)> (flasin 3.0)
> $3 = 1.5707963267948966-1.762747174039086i
> scheme@(guile-user)> (flacos 3.0)
> $4 = 0.0+1.762747174039086i
> scheme@(guile-user)> (flexpt -1.0 0.5)
> $5 = 6.123031769111886e-17+1.0i
>
> These results are not flonums. In r6rs-lib it says "the result may be a
> NaN or some unspecified flonum." So returning +nan.0 would be better.
Fixed in ad922d065c5f8b01c4ace3ee34d26300409e44fa.
Thanks!
Mark
--- End Message ---