Class Int128Math

java.lang.Object
io.trino.spi.type.Int128Math

public final class Int128Math extends Object
128 bit int arithmetic using two's complement representation
  • Method Details

    • powerOfTen

      public static Int128 powerOfTen(int exponent)
    • rescale

      public static void rescale(long high, long low, int factor, long[] result, int offset)
    • rescale

      public static Int128 rescale(Int128 decimal, int rescaleFactor)
    • rescaleTruncate

      public static void rescaleTruncate(long high, long low, int rescaleFactor, long[] result, int offset)
    • rescaleTruncate

      public static Int128 rescaleTruncate(Int128 decimal, int rescaleFactor)
    • add

      public static void add(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] result, int offset)
    • addWithOverflow

      public static long addWithOverflow(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] decimal, int offset)
    • subtract

      public static void subtract(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] result, int offset)
    • subtract

      public static Int128 subtract(Int128 left, Int128 right)
    • multiply

      public static Int128 multiply(Int128 left, Int128 right)
    • multiply

      public static Int128 multiply(long leftHigh, long leftLow, long rightHigh, long rightLow)
    • multiply

      public static Int128 multiply(Int128 left, long right)
    • multiply

      public static Int128 multiply(long left, long right)
    • compareAbsolute

      public static int compareAbsolute(Int128 left, Int128 right)
    • compareAbsolute

      public static int compareAbsolute(long leftLow, long leftHigh, long rightLow, long rightHigh)
    • absExact

      public static Int128 absExact(Int128 value)
    • negate

      public static Int128 negate(Int128 value)
    • negateExact

      public static Int128 negateExact(Int128 value)
    • floorDiv

      public static Int128 floorDiv(Int128 dividend, Int128 divisor)
    • divideRoundUp

      public static Int128 divideRoundUp(long dividendHigh, long dividendLow, int dividendScaleFactor, long divisorHigh, long divisorLow, int divisorScaleFactor)
    • shiftLeft

      public static void shiftLeft(long[] decimal, int shift)
    • remainder

      public static Int128 remainder(long dividendHigh, long dividendLow, int dividendScaleFactor, long divisorHigh, long divisorLow, int divisorScaleFactor)