Documentation of 'mikera.util.mathz.AlternativeMaths' Java class
AlternativeMaths
mikera.util.mathz

Class AlternativeMaths



  • public class AlternativeMaths
    extends java.lang.Object
    Mostly experimental. Alternative implementation sof maths functions.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AlternativeMaths() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int max2(int a, int b)
      Branchless max for ints
      static int min2(int a, int b)
      Branchless min for ints
      static int sign2(int a)
      Mike's fast integer sign algorithm
      static int sign2fast(int a)
      Fast branchless integer sign Not correct for MIN_INTEGER - but valid for all other int values
      static double tanh(double x) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AlternativeMaths

        public AlternativeMaths()
    • Method Detail

      • min2

        public static int min2(int a,
                               int b)
        Branchless min for ints
      • max2

        public static int max2(int a,
                               int b)
        Branchless max for ints
      • sign2fast

        public static int sign2fast(int a)
        Fast branchless integer sign Not correct for MIN_INTEGER - but valid for all other int values
      • tanh

        public static double tanh(double x)
      • sign2

        public static final int sign2(int a)
        Mike's fast integer sign algorithm
        Parameters:
        a -
        Returns:
        Sign of the given number (-1, 0 or 1)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.