Class UMath

java.lang.Object
convex.core.util.UMath

public class UMath extends Object
Functions for unsigned maths. It would be nice if Java included these by default.
  • Constructor Details

    • UMath

      public UMath()
  • Method Details

    • multiplyHigh

      public static long multiplyHigh(long a, long b)
      Gets the high 64 bits of an unsigned multiply
      Parameters:
      a - 64-bit long interpreted as unsigned value
      b - 64-bit long interpreted as unsigned value
      Returns:
      High 64 bits of unsigned multiply
    • unsignedAddCarry

      public static long unsignedAddCarry(long a, long b)
      Gets the carry of an unsigned addition of two longs
      Parameters:
      a - 64-bit long interpreted as unsigned value
      b - 64-bit long interpreted as unsigned value
      Returns:
      1 if the addition carries, 0 otherwise