Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.6
    • Fix Version/s: 0.6
    • Component/s: Parser
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      1

      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

          Activity

          Hide
          Rodrigo B. de Oliveira added a comment -

          Thanks!

          Show
          Rodrigo B. de Oliveira added a comment - Thanks!

            People

            • Assignee:
              Rodrigo B. de Oliveira
              Reporter:
              Doug H
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: