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


?1e+12  -- (same as 1e12)
?1e-12
?5      -- (same as 5.0)
--?1.   -- (illegal, use 1 or 1.0)
?.1     -- (same as 0.1)
?1/3    -- 0.333333
printf(1,"%g %G\n",1e-30)
