[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14871: flonum procedures returning non-flonum objects
From: |
Göran Weinholt |
Subject: |
bug#14871: 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
pgpcwKdlXrMPi.pgp
Description: PGP signature
- bug#14871: flonum procedures returning non-flonum objects,
Göran Weinholt <=