Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Try code below: -

      <cfscript>
      myNumberArray = [];
      myNumberArray[1] = -1;
      myNumberArray[2] = -100;
      myNumberArray[3] = -200;

      writeoutput('<p>The largest number is #ArrayMax(myNumberArray)#</p>'); // should be -1

      writeoutput('<p>The smallest number is #ArrayMin(myNumberArray)#</p>'); // should be -200

      </cfscript>

      Show
      Try code below: - <cfscript> myNumberArray = []; myNumberArray [1] = -1; myNumberArray [2] = -100; myNumberArray [3] = -200; writeoutput('<p>The largest number is #ArrayMax(myNumberArray)#</p>'); // should be -1 writeoutput('<p>The smallest number is #ArrayMin(myNumberArray)#</p>'); // should be -200 </cfscript>

      Description

      An array containing only negative numbers returns 0 using ArrayMax function. Try code below: -

      <cfscript>
      myNumberArray = [];
      myNumberArray[1] = -1;
      myNumberArray[2] = -100;
      myNumberArray[3] = -200;

      writeoutput('<p>The largest number is #ArrayMax(myNumberArray)#</p>'); // should be -1

      writeoutput('<p>The smallest number is #ArrayMin(myNumberArray)#</p>'); // should be -200

      </cfscript>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                xebu Jatin Nanda
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: