* bug#14871: flonum procedures returning non-flonum objects
@ 2013-07-15 13:38 Göran Weinholt
2013-07-16 8:53 ` Mark H Weaver
0 siblings, 1 reply; 2+ messages in thread
From: Göran Weinholt @ 2013-07-15 13:38 UTC (permalink / raw)
To: 14871
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
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 <goran@weinholt.se>
"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
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#14871: flonum procedures returning non-flonum objects
2013-07-15 13:38 bug#14871: flonum procedures returning non-flonum objects Göran Weinholt
@ 2013-07-16 8:53 ` Mark H Weaver
0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2013-07-16 8:53 UTC (permalink / raw)
To: Göran Weinholt; +Cc: 14871-done
Göran Weinholt <goran@weinholt.se> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-16 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-15 13:38 bug#14871: flonum procedures returning non-flonum objects Göran Weinholt
2013-07-16 8:53 ` Mark H Weaver
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).