Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1273

Negative zero support in FastMath.pow

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.0
    • 4.0, 3.6
    • None
    • None
    • Patch

    Description

      FastMath.pow(double, double) and FastMath.pow(double, long) functions never return negative zero.
      Math.pow(-0.0, 5.0) = -0.0
      FastMath.pow(-0.0, 5.0) = 0.0
      Math.pow(-∞, -3.0) = -0.0
      FastMath.pow(-∞, -3.0) = 0.0
      Added support for negative zero.
      Also, added ultimate tests to cover all special cases described in Math.pow javadoc.
      Slightly edited an existing test: there were some typos and duplicates.

      Attachments

        1. MATH-1273.patch
          27 kB
          Qualtagh

        Activity

          People

            Unassigned Unassigned
            Qualtagh Qualtagh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: