emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14865: closed (flmax and flmin do not handle +nan.


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14865: closed (flmax and flmin do not handle +nan.0 correctly)
Date: Tue, 16 Jul 2013 09:28:02 +0000

Your message dated Tue, 16 Jul 2013 05:27:30 -0400
with message-id <address@hidden>
and subject line Re: bug#14865: flmax and flmin do not handle +nan.0 correctly
has caused the debbugs.gnu.org bug report #14865,
regarding flmax and flmin do not handle +nan.0 correctly
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14865: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14865
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: flmax and flmin do not handle +nan.0 correctly Date: Mon, 15 Jul 2013 13:11:47 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Hello schemers,

the flmax and flmin procedures from (rnrs) do not handle +nan.0
correctly:

scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (flmax +inf.0 +nan.0)
$1 = +inf.0
scheme@(guile-user)> (flmin -inf.0 +nan.0)
$2 = -inf.0

The result should be +nan.0. From r6rs-lib: "They always return a NaN
when one or more of the arguments is a NaN." Tested with
2.0.9.22-7e816-dirty.

Regards,

-- 
Göran Weinholt <address@hidden>
It's a beautiful day.
Don't let it get away.

Attachment: pgplc7vDnS8hK.pgp
Description: PGP signature


--- End Message ---
--- Begin Message --- Subject: Re: bug#14865: flmax and flmin do not handle +nan.0 correctly Date: Tue, 16 Jul 2013 05:27:30 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Göran Weinholt <address@hidden> writes:

> the flmax and flmin procedures from (rnrs) do not handle +nan.0
> correctly:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (flmax +inf.0 +nan.0)
> $1 = +inf.0
> scheme@(guile-user)> (flmin -inf.0 +nan.0)
> $2 = -inf.0
>
> The result should be +nan.0. From r6rs-lib: "They always return a NaN
> when one or more of the arguments is a NaN."

Indeed.  I had actually carefully implemented 'min' and 'max' according
to R6RS section 11.7.4 (Numerical operations), which states:

   For any real number object x:
     (max +inf.0 x) => +inf.0
     (min -inf.0 x) => -inf.0

and section 3.5 states that NaNs are real number objects.

At first I was baffled by the inconsistency between min/max and
flmin/flmax, but now I see that the R6RS errata corrected this:

   The examples for min and max involving infinities should be prefixed by:
   "For any real number object x /that is not a NaN/:"

Fixed in b4c55c9ccedd47c16007b590f064ef3bd67565aa.

    Thanks!
      Mark


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]