public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "wilson at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/26483] Wrong parsing of doubles when interpreted
Date: Tue, 28 Feb 2006 03:25:00 -0000	[thread overview]
Message-ID: <20060228032547.25357.qmail@sourceware.org> (raw)
In-Reply-To: <bug-26483-3744@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from wilson at gcc dot gnu dot org  2006-02-28 03:25 -------
The number 5e-324 exceeds the range of the (C language) double type.  So the
result you get will depend on how overflow is handled.  If I use a number
within the range of double, it works fine.  I don't know what Java is supposed
to do in the presence of overflow here.

Compile this with -E
#include <float.h>
DBL_MIN_10_EXP
and we get a result of -307.  So 5e-324 is an out-of-range number.

The number is within range of an IA-64/x86 80-bit FP long double number. 
LDBL_MIN_10_EXP is -4931.  So if long doubles are being used, intentionally or
accidentally, this could work.

On an x86_64 system, I get an answer of 0.0 for both the compiled and
interpreted tests.  If I use -m32 when compiling, I get the answer "5E-324".  I
don't have a 32-bit compiled interpreter, so I can't check that.

Without access to a copy of the Java standard, it isn't clear to me what the
correct answer is here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26483


  parent reply	other threads:[~2006-02-28  3:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27 16:18 [Bug libgcj/26483] New: " konqueror at gmx dot de
2006-02-27 16:20 ` [Bug libgcj/26483] " konqueror at gmx dot de
2006-02-27 17:03 ` pinskia at gcc dot gnu dot org
2006-02-27 17:26 ` konqueror at gmx dot de
2006-02-28  3:25 ` wilson at gcc dot gnu dot org [this message]
2006-02-28 21:15 ` joseph at codesourcery dot com
2006-02-28 21:40 ` schwab at suse dot de
2006-02-28 21:50 ` joseph at codesourcery dot com
2006-02-28 22:02 ` schwab at suse dot de
2006-03-06 17:08 ` [Bug libgcj/26483] Wrong parsing of doubles when interpreted on ia64 tromey at gcc dot gnu dot org
2006-03-08  0:46 ` wilson at gcc dot gnu dot org
2006-03-08  0:51 ` wilson at gcc dot gnu dot org
2006-04-04 19:07 ` tromey at gcc dot gnu dot org
2006-04-04 20:22 ` wilson at tuliptree dot org
2006-04-04 20:24 ` wilson at gcc dot gnu dot org
2006-04-04 20:46 ` andreast at gcc dot gnu dot org
2006-04-07 23:01 ` wilson at tuliptree dot org
2006-04-07 23:04 ` wilson at gcc dot gnu dot org
2006-04-12 22:10 ` wilson at gcc dot gnu dot org
2006-04-12 22:21 ` wilson at gcc dot gnu dot org
2006-04-12 22:22 ` wilson at gcc dot gnu dot org
2006-05-26 14:58 ` konqueror at gmx dot de
2006-06-01 22:36 ` wilson at gcc dot gnu dot org
2006-06-17  1:01 ` tromey at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060228032547.25357.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).