ERights Home elang / kernel 
Back to: Integer Literal Expression On to: Char Literal Expression

Float64 Literal Expression


Has the conventional meaning -- evaluates to the expressed IEEE double precision floating point value. As in Java, in E you can only express non-negative non-inifinite non-NaN values literally. All other values require other expressions. This should make no difference to the E programmer in practice.

Lexical Regex:
[0-9]+[.][0-9]*([eE][-]?[0-9]+)
[0-9]+[eE][-]?[0-9]+

This is a subset of the syntax allowed for Java double precision floating point literals, in that neither a leading "." nor a trailing "d" or "D" are allowed.

XML DTD:
<!ELEMENT Float64 #PCDATA>

Where the #PCDATA must conform to the above regex, and should be written as it appears in the source text.

Java:

All IEEE double precision numbers expressible as literals in Java are expressible as Float64Literals in E. An E Float64Literal translates to precisely the same text in Java, and will designate precisely the same IEEE double precision floating point value.

Future versions of the E compiler should try to determine when it can use the scalar rather than widening it to a Double object. However, in the general case (and currently the only case), this will translate to

new Double(double-literal)
Example:
2.3
in Kernel-E:
same
in XML:
<Float64>2.3</Float64>
in Java
new Double(2.3)

x
 
Unless stated otherwise, all text on this page which is either unattributed or by Mark S. Miller is hereby placed in the public domain.
ERights Home elang / kernel 
Back to: Integer Literal Expression On to: Char Literal Expression
Download    FAQ    API    Mail Archive    Donate

report bug (including invalid html)

Golden Key Campaign Blue Ribbon Campaign