/** * Check if a floating point type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkFloatSupported( final int bits) throws UnsupportedOperationException { if (!isFloatSupported(bits)) { return unsupported(bits, "float", SUPPORTED_FLOAT); } return bits; }
/** * Check if a floating point type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkFloatSupported( final int bits) throws UnsupportedOperationException { if (!isFloatSupported(bits)) { return unsupported(bits, "float", SUPPORTED_FLOAT); } return bits; }
/** * Check if an unsigned integer type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkIntegerUnsignedSupported( final int bits) throws UnsupportedOperationException { if (!isIntegerUnsignedSupported(bits)) { return unsupported(bits, "unsigned integer", SUPPORTED_INTEGER_UNSIGNED); } return bits; }
/** * Check if an unsigned integer type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkIntegerUnsignedSupported( final int bits) throws UnsupportedOperationException { if (!isIntegerUnsignedSupported(bits)) { return unsupported(bits, "unsigned integer", SUPPORTED_INTEGER_UNSIGNED); } return bits; }
/** * Check if a signed integer type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkIntegerSignedSupported( final int bits) throws UnsupportedOperationException { if (!isIntegerSignedSupported(bits)) { return unsupported(bits, "signed integer", SUPPORTED_INTEGER_SIGNED); } return bits; }
/** * Check if a signed integer type with the given size is supported. * * @param bits The size in bits * * @return {@code bits} * * @throws UnsupportedOperationException If the size is not supported */ public static int checkIntegerSignedSupported( final int bits) throws UnsupportedOperationException { if (!isIntegerSignedSupported(bits)) { return unsupported(bits, "signed integer", SUPPORTED_INTEGER_SIGNED); } return bits; }