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


XS4      DC  E'1.23456E-4'       short floating-point
 
XDPI     DC  D'3.141592653589793' long floating-point
XD1      DC  D'0'                 long floating-point
XD2      DC  D'1'                 long floating-point
XD3      DC  D'-1'                long floating-point
XD4      DC  D'1.2345E-4'         long floating-point
 
XQPI     DC  L'3.14159265358979323846264338327950' extended
 
* short    floating-point -  32 bits -  4 bytes :  6 decimal digits
* long     floating-point -  64 bits -  8 bytes : 16 decimal digits
* extended floating-point - 128 bits - 16 bytes : 33 decimal digits
 
* absolute approximate range: 5e-79 to 7e75 