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

FastMath.signum(-0.0) does not agree with Math.signum(-0.0) ; no tests for signum

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 3.0
    • Fix Version/s: 2.2, 3.0
    • Labels:
      None

      Description

      There are no unit tests for FastMath.signum(double) as yet.

      Here is one that should work, but fails:

      @Test
      public void testSignum() {
          Assert.assertTrue(Double.valueOf(FastMath.signum(+0.0)).equals(Double.valueOf(Math.signum(+0.0)))); // OK
          Assert.assertTrue(Double.valueOf(FastMath.signum(-0.0)).equals(Double.valueOf(Math.signum(-0.0)))); // FAILS
      }
      

        Attachments

        1. Math479.patch
          2 kB
          Sebb

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: