Programming languages have different ways of expressing floating-point literals.



Task

Show how floating-point literals can be expressed in your language: decimal or other bases, exponential notation, and any other special features.

You may want to include a regular expression or BNF/ABNF/EBNF defining allowable formats for your language.



Related tasks

   Literals/Integer
   Extreme floating point values


 
1.2345e-4      decimal floating-point
7e5            decimal floating-point
1.234_567_89e0 decimal floating-point.
1.0s0          decimal floating-point (single precision)
1.0d0          decimal floating-point (double precision)
1.34q0         decimal floating-point (quadruple/extended precision)
 
111.0101e7b    binary floating-point equals 111.0101 * 2**7
                                     or 7.3125 * 2**7
1e5b           binary floating-point equals 1 * 2**5
 