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


 
#lang racket
.2
2.
2.+0i  ; zero imaginary part
2e0
#x10.8 ; hex float
#o1e2  ; oct float
2.0f0  ; single float
1.0t0  ; extended 80-bit float (when available on platform)
 