public class Decimals extends Object
| Modifier and Type | Field and Description |
|---|---|
static BigInteger |
MAX_DECIMAL_UNSCALED_VALUE |
static int |
MAX_PRECISION |
static int |
MAX_SHORT_PRECISION |
static BigInteger |
MIN_DECIMAL_UNSCALED_VALUE |
static int |
SIZE_OF_LONG_DECIMAL |
| Modifier and Type | Method and Description |
|---|---|
static BigInteger |
bigIntegerTenToNth(int n) |
static void |
checkOverflow(BigInteger value) |
static BigInteger |
decodeUnscaledValue(io.airlift.slice.Slice valueSlice) |
static io.airlift.slice.Slice |
encodeScaledValue(BigDecimal value) |
static io.airlift.slice.Slice |
encodeUnscaledValue(BigInteger unscaledValue) |
static io.airlift.slice.Slice |
encodeUnscaledValue(long unscaledValue) |
static boolean |
isLongDecimal(Type type) |
static boolean |
isShortDecimal(Type type) |
static long |
longTenToNth(int n) |
static boolean |
overflows(BigDecimal value,
long precision) |
static boolean |
overflows(BigInteger value) |
static boolean |
overflows(BigInteger value,
int precision) |
static boolean |
overflows(long value,
int precision) |
static DecimalParseResult |
parse(String stringValue) |
static DecimalParseResult |
parseIncludeLeadingZerosInPrecision(String stringValue) |
static BigInteger |
rescale(BigInteger value,
int fromScale,
int toScale) |
static long |
rescale(long value,
int fromScale,
int toScale) |
static String |
toString(BigInteger unscaledValue,
int scale) |
static String |
toString(long unscaledValue,
int scale) |
static String |
toString(io.airlift.slice.Slice unscaledValue,
int scale) |
static void |
writeBigDecimal(DecimalType decimalType,
BlockBuilder blockBuilder,
BigDecimal value) |
public static final int SIZE_OF_LONG_DECIMAL
public static final int MAX_PRECISION
public static final int MAX_SHORT_PRECISION
public static final BigInteger MAX_DECIMAL_UNSCALED_VALUE
public static final BigInteger MIN_DECIMAL_UNSCALED_VALUE
public static long longTenToNth(int n)
public static BigInteger bigIntegerTenToNth(int n)
public static DecimalParseResult parse(String stringValue)
public static DecimalParseResult parseIncludeLeadingZerosInPrecision(String stringValue)
public static io.airlift.slice.Slice encodeUnscaledValue(BigInteger unscaledValue)
public static io.airlift.slice.Slice encodeUnscaledValue(long unscaledValue)
public static io.airlift.slice.Slice encodeScaledValue(BigDecimal value)
public static BigInteger decodeUnscaledValue(io.airlift.slice.Slice valueSlice)
public static String toString(long unscaledValue, int scale)
public static String toString(io.airlift.slice.Slice unscaledValue, int scale)
public static String toString(BigInteger unscaledValue, int scale)
public static boolean overflows(long value,
int precision)
public static boolean overflows(BigInteger value, int precision)
public static boolean overflows(BigInteger value)
public static boolean overflows(BigDecimal value, long precision)
public static void checkOverflow(BigInteger value)
public static void writeBigDecimal(DecimalType decimalType, BlockBuilder blockBuilder, BigDecimal value)
public static long rescale(long value,
int fromScale,
int toScale)
public static BigInteger rescale(BigInteger value, int fromScale, int toScale)
public static boolean isShortDecimal(Type type)
public static boolean isLongDecimal(Type type)
Copyright © 2012-2016. All Rights Reserved.