Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-2861

Bug in scientific notation parsing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 4.2.0.000
    • Fix Version/s: None
    • Labels:
      None

      Description

      This code errors:

      <cfset n = 1E2>
      <cfoutput>
      n: #n#<br>
      isNumeric(): #isNumeric(n)#<br>
      val(): #val(n)#<br>
      n*1: #n*1#<br>
      </cfoutput>
      

      tag [cfset] is not closed
      at railo.transformer.cfml.tag.CFMLTransformer.createTemplateException(CFMLTransformer.java:1130):1130
      at railo.transformer.cfml.tag.CFMLTransformer.tag(CFMLTransformer.java:564):564
      at railo.transformer.cfml.tag.CFMLTransformer.body(CFMLTransformer.java:328):328
      at railo.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:268):268
      at railo.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:139):139
      at railo.runtime.compiler.CFMLCompilerImpl.compile(CFMLCompilerImpl.java:54):54

      On ColdFusion it yields this:

      n: 1E2
      isNumeric(): YES
      val(): 1
      n*1: 100

      This declaration for n works:

      <cfset n = 1.0E2>
      

      Result in Railo:

      n: 100
      isNumeric(): true
      val(): 100
      n*1: 100

      And CF:

      n: 1.0E2
      isNumeric(): YES
      val(): 1
      n*1: 100

      I'm guessing Railo's not considering it scientific notation unless it has at least one decimal place. I thought this might be correct, but JavaScript (as a random benchmark) allows for the 1E2 syntax just fine.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                adamcameroncf Adam Cameron
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: