www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - (docs) hexadecimal floats

reply "Carlos Santander B." <csantander619 gmail.com> writes:
Either it's a bug, or I don't understand something.
In lex.html, in the section Floating Literals, it reads:

Hexadecimal floats are preceded with a 0x and the exponent is a p  or P 
followed by a power of 2.

However, as an example, this is provided:

0x1.FFFFFFFFFFFFFp1023		// double.max

I tested it on dmd 0.110 for windows, and it's accepted as valid, but 
1023 clearly is not a power of 2.


_______________________
Carlos Santander Bernal
Jan 12 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Carlos Santander B." <csantander619 gmail.com> wrote in message
news:cs4ki9$ren$1 digitaldaemon.com...
 Either it's a bug, or I don't understand something.
 In lex.html, in the section Floating Literals, it reads:

 Hexadecimal floats are preceded with a 0x and the exponent is a p  or P
 followed by a power of 2.

 However, as an example, this is provided:

 0x1.FFFFFFFFFFFFFp1023 // double.max

 I tested it on dmd 0.110 for windows, and it's accepted as valid, but
 1023 clearly is not a power of 2.

It should read an exponent of 2, as in 2^1023.
Jan 19 2005
parent "Carlos Santander B." <csantander619 gmail.com> writes:
Walter wrote:
 "Carlos Santander B." <csantander619 gmail.com> wrote in message
 news:cs4ki9$ren$1 digitaldaemon.com...
 
Either it's a bug, or I don't understand something.
In lex.html, in the section Floating Literals, it reads:

Hexadecimal floats are preceded with a 0x and the exponent is a p  or P
followed by a power of 2.

However, as an example, this is provided:

0x1.FFFFFFFFFFFFFp1023 // double.max

I tested it on dmd 0.110 for windows, and it's accepted as valid, but
1023 clearly is not a power of 2.

It should read an exponent of 2, as in 2^1023.

Oh, I see. _______________________ Carlos Santander Bernal
Jan 20 2005