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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2, 3.0
    • 2.2, 3.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: