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

Faster implementation of FastMath.abs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.1
    • 3.2
    • None

    Description

      Faster implementations of abs() which use bitwise operations in preference to branching. By my benchmark abs(double/float) are about 10-20% faster, and abs(long/int) more than twice as fast. Patch attached.

      Attachments

        1. patch
          1 kB
          Charles Cooper
        2. patch
          1 kB
          Charles Cooper

        Activity

          People

            Unassigned Unassigned
            coopercm Charles Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: