Class MathUtils


  • public class MathUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MathUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long modInverse​(long val)
      Computes the inverse mod given a value and bits to shift left by
      static java.math.BigInteger modInverse​(java.math.BigInteger val, int bits)
      Computes the inverse mod given a value and bits to shift left by
      • Methods inherited from class java.lang.Object

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

      • MathUtils

        public MathUtils()
    • Method Detail

      • modInverse

        public static java.math.BigInteger modInverse​(java.math.BigInteger val,
                                                      int bits)
        Computes the inverse mod given a value and bits to shift left by
        Parameters:
        val - BigInteger value
        bits - int number of bits to shift left
        Returns:
        Mod inverse of the value passed.
      • modInverse

        public static long modInverse​(long val)
        Computes the inverse mod given a value and bits to shift left by
        Parameters:
        val - BigInteger value
        Returns:
        Mod inverse of the value passed.