Subject: bug#14871: closed (Re: bug#14871: flonum procedures returning non-flonum objects)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 16 Jul 2013 08:55:02 +0000

Your bug report

#14871: flonum procedures returning non-flonum objects

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
14871: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14871
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#14871: flonum procedures returning non-flonum objects
From: Mark H Weaver <[email-masked]>
To: Göran Weinholt <[email-masked]>
Cc: [email-masked]
Date: Tue, 16 Jul 2013 04:53:49 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Göran Weinholt <[email-masked]> 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

Subject: flonum procedures returning non-flonum objects
From: Göran Weinholt <[email-masked]>
To: [email-masked]
Date: Mon, 15 Jul 2013 15:38:56 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]>
"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