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


println 1.00f    // float (IEEE-32)
println 1.00d    // double (IEEE-64)
println 1.00     // BigDecimal (scaled BigInteger)
println 1.00g    // BigDecimal
println 1.00e0   // BigDecimal
 
assert 1.00f  instanceof Float
assert 1.00d  instanceof Double
assert 1.00   instanceof BigDecimal
assert 1.00g  instanceof BigDecimal
assert 1.00e0 instanceof BigDecimal