Details

    • Type: Bug
    • Status: Deployed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2.6.29
    • Fix Version/s: 5.2.6.32
    • Labels:
      None

      Description

      https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/functions/math/InputBaseN.java

      public static double call(PageContext pc , String string, double radix) throws ExpressionException {
          ...
          return (int)Long.parseLong(string, (int)radix);
      }
      

      Long.parseLong(string, radix) is performing the actual BaseN conversion.
      The returned value is a double.
      However there is a casting to (int) which appears to be unnecessary.

      The consequence is that the following code does not return the correct result:

      <cfdump var="#InputBaseN('40390719E3C0', 16)#">
      

      This returns the correct result:

      <cfdump var="#CreateObject('java', 'java.lang.Long').parseLong('40390719E3C0', 16)#">
      

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              simondotau Simon Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: