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

Faster implementation of FastMath.abs

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.2
    • Environment:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: