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

Negative zero support in FastMath.pow

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0, 3.6
    • Labels:
      None
    • Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: