Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25665 > unrolled thread

Re: Works for me

Started byNigel Wade <nmw-news@ion.le.ac.uk>
First post2011-02-08 14:21 +0000
Last post2011-02-08 11:34 -0800
Articles 4 — 4 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Works for me Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-02-08 14:21 +0000
    Re: Works for me Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-09 12:07 +1300
    Re: Works for me Paul Cager <paul.cager@googlemail.com> - 2011-02-08 08:12 -0800
    Re: Works for me Lew <lew@lewscanon.com> - 2011-02-08 11:34 -0800

#25665 — Re: Works for me

FromNigel Wade <nmw-news@ion.le.ac.uk>
Date2011-02-08 14:21 +0000
SubjectRe: Works for me
Message-ID<8rd1qtF75jU1@mid.individual.net>
On 08/02/11 09:16, Lawrence D'Oliveiro wrote:
> root@theon:~ # dpkg-query -s sun-java6-jdk
> Package: sun-java6-jdk
> Status: install ok installed
> Priority: optional
> Section: non-free/java
> Installed-Size: 59940
> Maintainer: Debian Java Maintainers <pkg-java-
> maintainers@lists.alioth.debian.org>
> Architecture: amd64
> Source: sun-java6
> Version: 6.22-1
> Provides: java-compiler, java-sdk, java2-compiler, java2-sdk, java5-sdk, 
> java6-sdk
> Depends: sun-java6-bin (>= 6.22-1), libc6, libx11-6
> Pre-Depends: debconf (>= 0.5) | debconf-2.0
> Suggests: sun-java6-demo, openjdk-6-doc, sun-java6-source
> Description: Sun Java(TM) Development Kit (JDK) 6
>  The JDK(TM) is a development environment for building applications,
>  applets, and components using the Java programming language.
>  .
>  The JDK includes tools useful for developing and testing programs
>  written in the Java programming language and running on the Java
>  Platform.
>  .
>  NOTE: You must accept Sun's EULA prior to successfully installing
>  this package
> Homepage: https://jdk-distros.dev.java.net
> 
> ldo@theon:java_try> cat test.java
> class test
>   {
>     public static void main(String[] args)
>       {
>         System.out.print("Got...");
>         double c = 2.2250738585072011e-308;
>         System.out.println(" here.");
>       } /*main*/
>   }
> 
> ldo@theon:java_try> javac test.java
> ldo@theon:java_try> java test
> Got... here.
> 

The number should be 2.2250738585072012e-308
The number you have used is the one which affects PHP.

Precision in computing is important.

If your Java version is hit by the bug your code will hang the compiler.
If you want to compile the class and test the bytecode on different JVM
then use Double.parseDouble to parse a string constant. So far all these
versions I've tried are affected by this bug:

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"

-- 
Nigel Wade

[toc] | [next] | [standalone]


#25737

FromLawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Date2011-02-09 12:07 +1300
Message-ID<iisibr$3l4$12@lust.ihug.co.nz>
In reply to#25665
In message <8rd1qtF75jU1@mid.individual.net>, Nigel Wade wrote:

> The number should be 2.2250738585072012e-308

Yup, that’s it, javac is now stuck in a loop. :)

[toc] | [prev] | [next] | [standalone]


#25830

FromPaul Cager <paul.cager@googlemail.com>
Date2011-02-08 08:12 -0800
Message-ID<97720862-1209-4446-a0ab-9072eabb46e1@k16g2000vbq.googlegroups.com>
In reply to#25665
On Feb 8, 2:21 pm, Nigel Wade <nmw-n...@ion.le.ac.uk> wrote:

> The number should be 2.2250738585072012e-308
> The number you have used is the one which affects PHP.
>
> Precision in computing is important.
>
> If your Java version is hit by the bug your code will hang the compiler.
> If you want to compile the class and test the bytecode on different JVM
> then use Double.parseDouble to parse a string constant. So far all these
> versions I've tried are affected by this bug:
>
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
> Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
> OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
> OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"

GCJ isn't affected by the way:
sh-3.2$ gcj --main=Test Test.java
  Test.java:6: warning: The local variable c is never read
        double c = 2.2250738585072012e-308;
               ^
  1 problem (1 warning)

sh-3.2$ ./a.out
  Got... here.

sh-3.2$ gcj --version
  gcj (Debian 4.3.2-2) 4.3.2

[toc] | [prev] | [next] | [standalone]


#26153

FromLew <lew@lewscanon.com>
Date2011-02-08 11:34 -0800
Message-ID<6d4078aa-de88-4828-8a0a-da79472a7143@d17g2000vbn.googlegroups.com>
In reply to#25665
Nigel Wade wrote:
> The number should be 2.2250738585072012e-308
> The number you have used is the one which affects PHP.
>
> Precision in computing is important.
>
> If your Java version is hit by the bug your code will hang the compiler.
>

And thus NetBeans' IDE as it tries to internally compile the source.
Oracle JDK.

Evil!

> If you want to compile the class and test the bytecode on different JVM
> then use Double.parseDouble to parse a string constant. So far all these
> versions I've tried are affected by this bug:
>
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
> Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
> OpenJDK Client VM (build 14.0-b16, mixed mode) "1.6.0_17"
> OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) "1.6.0_18"
>

$ java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)

--
Lew

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web