/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a short value if it has no fractional * part and if its value fits to the short range ([-2<sup>15</sup>..2<sup>15</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary of the number doesn't fit in a short. */ public short shortValueExact() { return (short) valueExact(16); }
/** * Returns this {@code BigDecimal} as a byte value if it has no fractional * part and if its value fits to the byte range ([-128..127]). If these * conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a byte. */ public byte byteValueExact() { return (byte) valueExact(8); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a short value if it has no fractional * part and if its value fits to the short range ([-2<sup>15</sup>..2<sup>15</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary of the number doesn't fit in a short. */ public short shortValueExact() { return (short) valueExact(16); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a short value if it has no fractional * part and if its value fits to the short range ([-2<sup>15</sup>..2<sup>15</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary of the number doesn't fit in a short. */ public short shortValueExact() { return (short) valueExact(16); }
/** * Returns this {@code BigDecimal} as a byte value if it has no fractional * part and if its value fits to the byte range ([-128..127]). If these * conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a byte. */ public byte byteValueExact() { return (byte) valueExact(8); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a short value if it has no fractional * part and if its value fits to the short range ([-2<sup>15</sup>..2<sup>15</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary of the number doesn't fit in a short. */ public short shortValueExact() { return (short) valueExact(16); }
/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a long value if it has no fractional * part and if its value fits to the int range ([-2<sup>63</sup>..2<sup>63</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a long. */ public long longValueExact() { return valueExact(64); }
/** * Returns this {@code BigDecimal} as a byte value if it has no fractional * part and if its value fits to the byte range ([-128..127]). If these * conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in a byte. */ public byte byteValueExact() { return (byte) valueExact(8); }
/** * Returns this {@code BigDecimal} as a int value if it has no fractional * part and if its value fits to the int range ([-2<sup>31</sup>..2<sup>31</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary or the number doesn't fit in an int. */ public int intValueExact() { return (int) valueExact(32); }
/** * Returns this {@code BigDecimal} as a short value if it has no fractional * part and if its value fits to the short range ([-2<sup>15</sup>..2<sup>15</sup>-1]). If * these conditions are not met, an {@code ArithmeticException} is thrown. * * @throws ArithmeticException * if rounding is necessary of the number doesn't fit in a short. */ public short shortValueExact() { return (short) valueExact(16); }