Uploaded image for project: 'Commons Numbers'
  1. Commons Numbers
  2. NUMBERS-136

"log10" inconsistent with "log"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta1
    • Component/s: complex
    • Labels:
      None

      Description

      For special cases (containing NaN or infinities), method log10 does not return the same values as log() (cf. case commented out below).

          @Test
          public void testLog10Consistency() {
              // Infinities should map to the same values as computed with "log()".
              // Assertions.assertEquals(infInf.log(), infInf.log10());
              Assertions.assertEquals(infNegInf.log(), infNegInf.log10());
              Assertions.assertEquals(negInfInf.log(), negInfInf.log10());
              // Assertions.assertEquals(infNaN.log(), infNaN.log10());
              Assertions.assertEquals(negInfNaN.log(), negInfNaN.log10());
              // Assertions.assertEquals(nanInf.log(), nanInf.log10());
              Assertions.assertEquals(nanNegInf.log(), nanNegInf.log10());
          }
      

      To avoid duplication, I suggest that log10 calls log as part of its implementation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ericbarnhill Eric Barnhill
                Reporter:
                erans Gilles Sadowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m