RosettaCodeData/Task/Literals-Floating-point/Fennel/literals-floating-point.fennel
2023-07-01 13:44:08 -04:00

13 lines
491 B
Fennel

;;Numeric literals with a decimal component are treated as floating point.
3.14159 ;3.14159
;;An exponent can be specified via "e" or "E" and is always floating point.
2.3456e7 ;23456000.0
;;Hexadecimal literals are supported, including exponents via "p" or "P".
0x1234.abcd ;4660.6710968018
0x1234.56p3 ;37282.6875
;;Underscores can optionally be used to split numbers into readable chunks.
123_456.789 ;123456.789
0x1234_5678.9a ;305419896.60156