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


float = [ sign ], { decimal-digit }, decimal-point, decimal-digit, { decimal-digit }, [exponent]  
      | [ sign ], decimal-digit, { decimal-digit }, [ decimal-point, { decimal-digit } ], exponent ;   
exponent = exponent-marker, [ sign ], decimal-digit, { decimal-digit } ;
sign = "+" | "-" ;
decimal-point = "." ;
decimal-digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
exponent-marker = "e" | "E" | "s" | "S" | "d" | "D" | "f" | "F" | "l" | "L" ;