United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4896828 Request to support hexadecimal floating-point literals
4896828 : Request to support hexadecimal floating-point literals

Details
Type:
Enhancement
Submit Date:
2003-07-26
Status:
Closed
Updated Date:
2007-01-11
Project Name:
JDK
Resolved Date:
2007-01-11
Component:
specification
OS:
generic
Sub-Component:
language
CPU:
generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0

Related Reports
Relates:

Sub Tasks

Description
With the addition of library support for hexadecimal floating-point strings (bug 4826774) it would be convenient if those strings could also be used as floating-point literals in the Java source language, as is possible in C99.

A Java-style EBNF grammar for hexadecimal strings is available as part of the 4826774 work.

Having hexadecimal floating-point literal support would allow a precise way to specify floating-point constants that could then be propagated as constants by the compiler.

                                    

Comments
EVALUATION

Specified in JLS 3ed 3.10.2.
                                     
2007-01-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger


                                     
2004-06-14
WORK AROUND

Use the library methods; e.g.

double d = Double.parseDouble("0x1.0p0");

instead of

double d = 0x1.0p0;

However, in the former case d will not be treated as a constant expression by the javac compiler.
                                     
2004-06-11
EVALUATION

A reasonable idea.

###@###.### 2003-07-27

This has already passed CCC and the compiler work is proceeding nicely.

###@###.### 2003-09-09
                                     
2003-07-27



Hardware and Software, Engineered to Work Together