Literals/Floating point: Difference between revisions
Content added Content deleted
m (→{{header|Visual Basic}}: handling not-a-number) |
(Added Dyalect programming language) |
||
Line 283: | Line 283: | ||
=={{header|D}}== |
=={{header|D}}== |
||
D built-in floating point types include ''float'' (32-bit), ''double'' (64-bit) and ''real'' (machine hardware maximum precision floating point type, 80-bit on x86 machine) and respective complex number types. Here's information for [http://www.d-programming-language.org/lex.html#floatliteral Floating Literals]. |
D built-in floating point types include ''float'' (32-bit), ''double'' (64-bit) and ''real'' (machine hardware maximum precision floating point type, 80-bit on x86 machine) and respective complex number types. Here's information for [http://www.d-programming-language.org/lex.html#floatliteral Floating Literals]. |
||
=={{header|Dyalect}}== |
|||
Dyalect built-in types include only one floating point number of type ''Float'' (64-bit). Both regular and scientific notations are supported: |
|||
<lang Dyalect>var x = 42.02 |
|||
var y = 0.174e-17</lang> |
|||
EBNF grammar for the floating point number is as follows: |
|||
<pre>float = "." digit { digit } [ ("e"|"E") [ "+" | "-" ] digit { digit } ] |
|||
| digit { digit } |
|||
( |
|||
"." digit { digit } [ ( "e" | "E" ) ["+" | "-" ] digit { digit } ] |
|||
| ( "e" | "E") ["+" | "-" ] digit { digit } |
|||
).</pre> |
|||
=={{header|Eiffel}}== |
=={{header|Eiffel}}== |