36 #ifndef ION_DECIMAL_H_
37 #define ION_DECIMAL_H_
43 #error DECNUMDIGITS must be defined to be >= DECQUAD_Pmax
44 #elif DECNUMDIGITS < DECQUAD_Pmax
45 #error DECNUMDIGITS must be defined to be >= DECQUAD_Pmax
51 #define ION_DECIMAL_STRLEN(ion_decimal) \
52 ((size_t)(((ion_decimal)->type == ION_DECIMAL_TYPE_QUAD) \
54 : (((ion_decimal)->type == ION_DECIMAL_TYPE_UNKNOWN) \
56 : ((ion_decimal)->value.num_value->digits + 14) \
73 ION_DECIMAL_TYPE_UNKNOWN = 0,
195 ION_API_EXPORT iERR ion_decimal_to_int32(
const ION_DECIMAL *value, decContext *context, int32_t *p_int);
196 ION_API_EXPORT iERR ion_decimal_to_uint32(
const ION_DECIMAL *value, decContext *context, uint32_t *p_int);
226 ION_API_EXPORT iERR ion_decimal_to_integral_exact(
ION_DECIMAL *value,
const ION_DECIMAL *rhs, decContext *context);
227 ION_API_EXPORT iERR ion_decimal_to_integral_value(
ION_DECIMAL *value,
const ION_DECIMAL *rhs, decContext *context);
232 ION_API_EXPORT uint32_t ion_decimal_digits(
const ION_DECIMAL *value);
233 ION_API_EXPORT int32_t ion_decimal_get_exponent(
const ION_DECIMAL *value);
234 ION_API_EXPORT uint32_t ion_decimal_radix(
const ION_DECIMAL *value);
236 ION_API_EXPORT uint32_t ion_decimal_is_integer(
const ION_DECIMAL *value);
237 ION_API_EXPORT uint32_t ion_decimal_is_subnormal(
const ION_DECIMAL *value, decContext *context);
238 ION_API_EXPORT uint32_t ion_decimal_is_normal(
const ION_DECIMAL *value, decContext *context);
239 ION_API_EXPORT uint32_t ion_decimal_is_finite(
const ION_DECIMAL *value);
240 ION_API_EXPORT uint32_t ion_decimal_is_infinite(
const ION_DECIMAL *value);
241 ION_API_EXPORT uint32_t ion_decimal_is_nan(
const ION_DECIMAL *value);
242 ION_API_EXPORT uint32_t ion_decimal_is_negative(
const ION_DECIMAL *value);
243 ION_API_EXPORT uint32_t ion_decimal_is_zero(
const ION_DECIMAL *value);
244 ION_API_EXPORT uint32_t ion_decimal_is_canonical(
const ION_DECIMAL *value);
ION_API_EXPORT iERR ion_decimal_from_quad(ION_DECIMAL *value, decQuad *quad)
ION_API_EXPORT iERR ion_decimal_equals_quad(const decQuad *left, const decQuad *right, decContext *context, BOOL *is_equal)
ION_API_EXPORT iERR ion_decimal_from_number(ION_DECIMAL *value, decNumber *number)
ION_API_EXPORT iERR ion_decimal_free(ION_DECIMAL *value)
ION_API_EXPORT iERR ion_decimal_to_ion_int(const ION_DECIMAL *value, decContext *context, ION_INT *p_int)
ION_DECIMAL_TYPE
Definition: ion_decimal.h:72
@ ION_DECIMAL_TYPE_QUAD
Definition: ion_decimal.h:77
@ ION_DECIMAL_TYPE_NUMBER
Definition: ion_decimal.h:81
@ ION_DECIMAL_TYPE_NUMBER_OWNED
Definition: ion_decimal.h:85
ION_API_EXPORT iERR ion_decimal_zero(ION_DECIMAL *value)
ION_API_EXPORT iERR ion_decimal_from_ion_int(ION_DECIMAL *value, decContext *context, ION_INT *p_int)
ION_API_EXPORT iERR ion_decimal_to_string(const ION_DECIMAL *value, char *p_string)
ION_API_EXPORT iERR ion_decimal_compare(const ION_DECIMAL *left, const ION_DECIMAL *right, decContext *context, int32_t *result)
ION_API_EXPORT iERR ion_decimal_from_int32(ION_DECIMAL *value, int32_t num)
ION_API_EXPORT iERR ion_decimal_from_uint32(ION_DECIMAL *value, uint32_t num)
ION_API_EXPORT iERR ion_decimal_equals(const ION_DECIMAL *left, const ION_DECIMAL *right, decContext *context, BOOL *is_equal)
ION_API_EXPORT iERR ion_decimal_from_string(ION_DECIMAL *value, const char *str, decContext *context)
ION_API_EXPORT iERR ion_decimal_claim(ION_DECIMAL *value)
Definition: ion_decimal.h:89
Definition: ion_int.h:100