Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2000 15:48:40 -0400
From:      Randall Hopper <aa8vb@ipass.net>
To:        "Michael J. Ruhl" <mruhl@network-alchemy.com>
Cc:        stable@freebsd.org
Subject:   Re: float-to-double core dump on 3.4R
Message-ID:  <20000410154840.A1508@ipass.net>
In-Reply-To: <38F2AD45.785F4B36@network-alchemy.com>; from mruhl@network-alchemy.com on Mon, Apr 10, 2000 at 09:42:45PM -0700
References:  <20000408193053.A3689@ipass.net> <38F2AD45.785F4B36@network-alchemy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Michael J. Ruhl:
 |Are you getting a floating exception error?  I would expect that
 |behavior.

Yes.

 |You do f = FLT_MAX and then double it.  The result is the Not a number
 |error.  Then you try to put that error into another variable.  The
 |program is doing the right thing.

I do not get an exception when the Inf is generated.
The exception occurs when I promote that Inf value to a higher-precision
type which also has an Inf representation.

How can this be right?  This only makes sense if generating an Inf is not
an exception condition, but promoting an Inf to a higher-precision type is.

Is this the case?

Thanks,

Randall

 |Mike
 |
 |Randall Hopper wrote:
 |> 
 |>      #include <float.h>
 |> 
 |>      main()
 |>      {
 |>         float  f = FLT_MAX;
 |>         double d;
 |>         f = f * 2;
 |>         d = f;
 |>      }
 |> 
 |> Delete the "d=f" line and it doesn't core.  Put it in and it does
 |> (floating-point exception).
 |> 
 |> >From this it appears there may be a bug in the float-to-double promotion
 |> when f is Inf (or, at least I'd expect that f is Inf).
 |> 
 |> Any comments?  If not, I'll file the PR.
 |> 
 |> Thanks,
 |> 
 |> Randall Hopper
 |> 
 |> To Unsubscribe: send mail to majordomo@FreeBSD.org
 |> with "unsubscribe freebsd-stable" in the body of the message
Content-Description: Card for Michael J. Ruhl
 |begin:vcard 
 |n:Ruhl;Michael J.
 |tel;fax:(831) 460-3801
 |tel;work:(831) 460-3800 ext. 3872
 |x-mozilla-html:FALSE
 |url:http://www.employees.org/~mruhl
 |org:Network Alchemy;Quality Assurance
 |adr:;;1538 Pacific Ave;Santa Cruz;California;95060;U.S.A.
 |version:2.1
 |email;internet:mruhl@network-alchemy.com
 |title:Senior QA Engineer
 |fn:Michael J. Ruhl
 |end:vcard



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000410154840.A1508>