public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010"
       [not found] <20050818173012.23466.veldema@cs.fau.de>
@ 2005-08-18 22:41 ` robilad at kaffe dot org
  2005-08-19 16:20 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: robilad at kaffe dot org @ 2005-08-18 22:41 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From robilad at kaffe dot org  2005-08-18 22:41 -------
that looks like a bug in Sun's implementation, as the Double.toString() API
specs demand that Double.toString returns only as many digits as necessary to
uniquely identify the floating point number. 

Adding one or more '0' digits does not seem useful, as 0.001 and 0.0010 are
mathematically speaking the same number. It would in fact seem to violate the
API specifications.

cheers,
dalibor topic

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010"
       [not found] <20050818173012.23466.veldema@cs.fau.de>
  2005-08-18 22:41 ` [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010" robilad at kaffe dot org
@ 2005-08-19 16:20 ` tromey at gcc dot gnu dot org
  2005-08-22 12:03 ` veldema at cs dot fau dot de
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-08-19 16:20 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-08-19 16:20 -------
I agree that this is most likely not a libgcj bug.
Ronald, why do you think the _dtoa call ought to be changed?


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010"
       [not found] <20050818173012.23466.veldema@cs.fau.de>
  2005-08-18 22:41 ` [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010" robilad at kaffe dot org
  2005-08-19 16:20 ` tromey at gcc dot gnu dot org
@ 2005-08-22 12:03 ` veldema at cs dot fau dot de
  2005-08-22 12:18 ` veldema at cs dot fau dot de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: veldema at cs dot fau dot de @ 2005-08-22 12:03 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From veldema at cs dot fau dot de  2005-08-22 12:03 -------
1) I will file a bug report with SUN and see what they say and report back here
2) I read the comments with _dtoa and for floats the arg is interpretted as
single-precision if mode >= 16 (seems for a double you both need to pass the
isfloat = false && mode == 20
R.

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010"
       [not found] <20050818173012.23466.veldema@cs.fau.de>
                   ` (2 preceding siblings ...)
  2005-08-22 12:03 ` veldema at cs dot fau dot de
@ 2005-08-22 12:18 ` veldema at cs dot fau dot de
  2005-08-22 13:25 ` robilad at kaffe dot org
  2005-08-22 15:00 ` [Bug libgcj/23466] call to _dtoa is possibly incorrect tromey at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: veldema at cs dot fau dot de @ 2005-08-22 12:18 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From veldema at cs dot fau dot de  2005-08-22 12:18 -------
Confirmed, this is a bug in SUN's JDK since 2001.
Perhaps a a bug should be introduced to make libgcj/classpath bug compatible ?
if (double_string == "0.00x" && x != '0') return return "0.00x0" 
should do the trick.
Ronald.

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010"
       [not found] <20050818173012.23466.veldema@cs.fau.de>
                   ` (3 preceding siblings ...)
  2005-08-22 12:18 ` veldema at cs dot fau dot de
@ 2005-08-22 13:25 ` robilad at kaffe dot org
  2005-08-22 15:00 ` [Bug libgcj/23466] call to _dtoa is possibly incorrect tromey at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: robilad at kaffe dot org @ 2005-08-22 13:25 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From robilad at kaffe dot org  2005-08-22 13:25 -------
It seems to be clearly a bug in how some non-free implementation implements the
specifications.

Since Sun Microsystems has confirmed the bug in their implementation, and the
specification is clear on the matter, I don't think it makes sense to make GNU
Classpath less compatible.

Unless Sun has decided to ammend the API specification, I think this bug should
be closed and marked "invalid".

cheers,
dalibor topic

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libgcj/23466] call to _dtoa is possibly incorrect
       [not found] <20050818173012.23466.veldema@cs.fau.de>
                   ` (4 preceding siblings ...)
  2005-08-22 13:25 ` robilad at kaffe dot org
@ 2005-08-22 15:00 ` tromey at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-08-22 15:00 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-08-22 15:00 -------
I would prefer to leave the PR open to address the _dtoa issue.
I've updated the PR synopsis to reflect this.
I agree that we should not change our toString output, as ours is
correct.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Double.toString(0.0010) --->|call to _dtoa is possibly
                   |"0.001" ISO "0.0010"        |incorrect


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-22 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050818173012.23466.veldema@cs.fau.de>
2005-08-18 22:41 ` [Bug libgcj/23466] Double.toString(0.0010) ---> "0.001" ISO "0.0010" robilad at kaffe dot org
2005-08-19 16:20 ` tromey at gcc dot gnu dot org
2005-08-22 12:03 ` veldema at cs dot fau dot de
2005-08-22 12:18 ` veldema at cs dot fau dot de
2005-08-22 13:25 ` robilad at kaffe dot org
2005-08-22 15:00 ` [Bug libgcj/23466] call to _dtoa is possibly incorrect tromey at gcc dot gnu dot org

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).