Details
Description
This patch allows exponential notation for numbers. Here are some examples with comments:
x = 1e+2
print x, x.GetType() //100 int
x2 = 1e2 //the + sign is optional
print x2, x2.GetType() //100
x4 = 1.1e+2 //use a decimal point for better precision
print x4, x4.GetType() //110 double
x5 = 1.1e-2 //minus sign for negative exponents (but use decimal point since this is not for integers)
print x5, x5.GetType() //0.011
x6 = 1e+2L //you can use the L suffix
print x6, x6.GetType() //100 long
x7 = 6e+2s //timespans work as well
print x7, x7.GetType() //10:00
x8 = 10.0e-4h
print x8, x8.GetType() //3.6 seconds
x9 = .9e2 //numbers that start with a decimal point work
print x9, x9.GetType() //90
This syntax also works in interpolated expressions.
Issue Links
- is depended upon by
-
BOO-1
Generalize units in the syntax, allow pipeline to define new units
-
Thanks!