Class Int128Math
java.lang.Object
io.trino.spi.type.Int128Math
128 bit int arithmetic using two's complement representation
-
Method Summary
Modifier and TypeMethodDescriptionstatic Int128static voidadd(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] result, int offset) static longaddWithOverflow(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] decimal, int offset) static intcompareAbsolute(long leftLow, long leftHigh, long rightLow, long rightHigh) static intcompareAbsolute(Int128 left, Int128 right) static Int128divideRoundUp(long dividendHigh, long dividendLow, int dividendScaleFactor, long divisorHigh, long divisorLow, int divisorScaleFactor) static Int128static Int128multiply(long left, long right) static Int128multiply(long leftHigh, long leftLow, long rightHigh, long rightLow) static Int128static Int128static Int128static Int128negateExact(Int128 value) static Int128powerOfTen(int exponent) static Int128remainder(long dividendHigh, long dividendLow, int dividendScaleFactor, long divisorHigh, long divisorLow, int divisorScaleFactor) static voidrescale(long high, long low, int factor, long[] result, int offset) static Int128static voidrescaleTruncate(long high, long low, int rescaleFactor, long[] result, int offset) static Int128rescaleTruncate(Int128 decimal, int rescaleFactor) static voidshiftLeft(long[] decimal, int shift) static voidsubtract(long leftHigh, long leftLow, long rightHigh, long rightLow, long[] result, int offset) static Int128
-
Method Details
-
powerOfTen
-
rescale
public static void rescale(long high, long low, int factor, long[] result, int offset) -
rescale
-
rescaleTruncate
public static void rescaleTruncate(long high, long low, int rescaleFactor, long[] result, int offset) -
rescaleTruncate
-
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
-
multiply
-
multiply
-
multiply
-
multiply
-
compareAbsolute
-
compareAbsolute
public static int compareAbsolute(long leftLow, long leftHigh, long rightLow, long rightHigh) -
absExact
-
negate
-
negateExact
-
floorDiv
-
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)
-