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


 
.2      ; 0.2
2.      ; 2.0
2e3     ; 2000
2.+3.i  ; complex floating-point number
 
; in Scheme, floating-point numbers are inexact numbers
(inexact? 2.)
; #t
(inexact? 2)
; #f