[Issue 788] Compiler rejects hex floats in the format: HexPrefix HexDigits . HexDigits(opt) with binary-exponent-part required

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 10 12:16:30 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=788





------- Comment #1 from baryluk at mpi.int.pl  2007-01-10 14:16 -------
There is also another problem with HexFloat:

0x10f

Is this float (0x10)f, or double (0x10f)?

If, binary-exponent-part is really required, then spec is outdated, and there
is no problem:
0x10p0f       // float
0x10fp0       // double

"Hexadecimal floats are preceded with a 0x and the exponent is a p or P
followed by a decimal number serving as the exponent of 2."

so lexer grammar should be:

HexFloat:
        HexPrefix HexDigits . HexDigits HexExponent
        HexPrefix . HexDigits HexExponent
        HexPrefix HexDigits HexExponent


-- 



More information about the Digitalmars-d-bugs mailing list