dfp_number_sys/
bid128_000.rs

1//! # `bid128_000` bindings
2//!
3//! ```text
4//! bid128 _ 0 0 0
5//! ──┬───   ┬ ┬ ┬
6//!   │      │ │ │
7//!   │      │ │ └── status flags passed as a separate argument
8//!   │      │ └── rounding mode passed as a separate argument
9//!   │      └── result returned by value
10//!   └─────── 128-bit decimal in BID format
11//! ```
12
13use crate::{Class, Double, ExcFlags, Float, Long, LongLong, RndMode, Signed, BID128, BID32, BID64};
14use libc::{c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, c_ulonglong, c_ushort};
15use std::ffi::{CStr, CString};
16
17pub const BID128_MIN: BID128 = BID128([0x378D8E63FFFFFFFF, 0xDFFFED09BEAD87C0]);
18pub const BID128_MAX: BID128 = BID128([0x378D8E63FFFFFFFF, 0x5FFFED09BEAD87C0]);
19
20/// Value `Inf` represented as a 128-bit decimal floating-point.
21///
22/// # Example
23///
24/// ```
25/// use dfp_number_sys::bid128_000::*;
26/// use dfp_number_sys::EXE_CLEAR;
27///
28/// let x = BID128_INF;
29/// let mut flags = EXE_CLEAR;
30/// assert_eq!("+Inf", bid128_to_string(x, &mut flags));
31/// assert_eq!(EXE_CLEAR, flags);
32/// ```
33pub const BID128_INF: BID128 = BID128([0x0, 0x7800000000000000]);
34
35/// Value `-Inf` represented as a 128-bit decimal floating-point.
36///
37/// # Example
38///
39/// ```
40/// use dfp_number_sys::bid128_000::*;
41/// use dfp_number_sys::EXE_CLEAR;
42///
43/// let x = BID128_MINUS_INF;
44/// let mut flags = EXE_CLEAR;
45/// assert_eq!("-Inf", bid128_to_string(x, &mut flags));
46/// assert_eq!(EXE_CLEAR, flags);
47/// ```
48pub const BID128_MINUS_INF: BID128 = BID128([0x0, 0xF800000000000000]);
49
50/// Value `0` represented as a 128-bit decimal floating-point.
51///
52/// # Example
53///
54/// ```
55/// use dfp_number_sys::bid128_000::*;
56/// use dfp_number_sys::EXE_CLEAR;
57///
58/// let x = BID128_ZERO;
59/// let mut flags = EXE_CLEAR;
60/// assert_eq!("+0E+0", bid128_to_string(x, &mut flags));
61/// assert_eq!(EXE_CLEAR, flags);
62/// ```
63pub const BID128_ZERO: BID128 = BID128([0x0, 0x3040000000000000]);
64
65/// Value `-0` represented as a 128-bit decimal floating-point.
66///
67/// # Example
68///
69/// ```
70/// use dfp_number_sys::bid128_000::*;
71/// use dfp_number_sys::EXE_CLEAR;
72///
73/// let x = BID128_MINUS_ZERO;
74/// let mut flags = EXE_CLEAR;
75/// assert_eq!("-0E+0", bid128_to_string(x, &mut flags));
76/// assert_eq!(EXE_CLEAR, flags);
77/// ```
78pub const BID128_MINUS_ZERO: BID128 = BID128([0x0, 0xB040000000000000]);
79
80/// Value `1` represented as a 128-bit decimal floating-point.
81///
82/// # Example
83///
84/// ```
85/// use dfp_number_sys::bid128_000::*;
86/// use dfp_number_sys::EXE_CLEAR;
87///
88/// let x = BID128_ONE;
89/// let mut flags = EXE_CLEAR;
90/// assert_eq!("+1E+0", bid128_to_string(x, &mut flags));
91/// assert_eq!(EXE_CLEAR, flags);
92/// ```
93pub const BID128_ONE: BID128 = BID128([0x1, 0x3040000000000000]);
94
95/// Value `-1` represented as a 128-bit decimal floating-point.
96///
97/// # Example
98///
99/// ```
100/// use dfp_number_sys::bid128_000::*;
101/// use dfp_number_sys::EXE_CLEAR;
102///
103/// let x = BID128_MINUS_ONE;
104/// let mut flags = EXE_CLEAR;
105/// assert_eq!("-1E+0", bid128_to_string(x, &mut flags));
106/// assert_eq!(EXE_CLEAR, flags);
107/// ```
108pub const BID128_MINUS_ONE: BID128 = BID128([0x1, 0xB040000000000000]);
109
110/// Value `2` represented as a 128-bit decimal floating-point.
111///
112/// # Example
113///
114/// ```
115/// use dfp_number_sys::bid128_000::*;
116/// use dfp_number_sys::EXE_CLEAR;
117///
118/// let x = BID128_TWO;
119/// let mut flags = EXE_CLEAR;
120/// assert_eq!("+2E+0", bid128_to_string(x, &mut flags));
121/// assert_eq!(EXE_CLEAR, flags);
122/// ```
123pub const BID128_TWO: BID128 = BID128([0x2, 0x3040000000000000]);
124
125/// Value `-2` represented as a 128-bit decimal floating-point.
126///
127/// # Example
128///
129/// ```
130/// use dfp_number_sys::bid128_000::*;
131/// use dfp_number_sys::EXE_CLEAR;
132///
133/// let x = BID128_MINUS_TWO;
134/// let mut flags = EXE_CLEAR;
135/// assert_eq!("-2E+0", bid128_to_string(x, &mut flags));
136/// assert_eq!(EXE_CLEAR, flags);
137/// ```
138pub const BID128_MINUS_TWO: BID128 = BID128([0x2, 0xB040000000000000]);
139
140/// Value `0.1` represented as a 128-bit decimal floating-point.
141///
142/// # Example
143///
144/// ```
145/// use dfp_number_sys::bid128_000::*;
146/// use dfp_number_sys::EXE_CLEAR;
147///
148/// let x = BID128_ONE_TENTH;
149/// let mut flags = EXE_CLEAR;
150/// assert_eq!("+1E-1", bid128_to_string(x, &mut flags));
151/// assert_eq!(EXE_CLEAR, flags);
152/// ```
153pub const BID128_ONE_TENTH: BID128 = BID128([0x1, 0x303E000000000000]);
154
155/// Value **`1000000000`** represented as a 128-bit decimal floating-point.
156///
157/// # Example
158///
159/// ```
160/// use dfp_number_sys::bid128_000::*;
161/// use dfp_number_sys::EXE_CLEAR;
162///
163/// let x = BID128_BILLION;
164/// let mut flags = EXE_CLEAR;
165/// assert_eq!("+1000000000E+0", bid128_to_string(x, &mut flags));
166/// assert_eq!(EXE_CLEAR, flags);
167/// ```
168pub const BID128_BILLION: BID128 = BID128([0x3B9ACA00, 0x3040000000000000]);
169
170/// Value **`-1000000000`** represented as a 128-bit decimal floating-point.
171///
172/// # Example
173///
174/// ```
175/// use dfp_number_sys::bid128_000::*;
176/// use dfp_number_sys::EXE_CLEAR;
177///
178/// let x = BID128_MINUS_BILLION;
179/// let mut flags = EXE_CLEAR;
180/// assert_eq!("-1000000000E+0", bid128_to_string(x, &mut flags));
181/// assert_eq!(EXE_CLEAR, flags);
182/// ```
183pub const BID128_MINUS_BILLION: BID128 = BID128([0x3B9ACA00, 0xB040000000000000]);
184
185extern "C" {
186  fn __bid128_abs(x: BID128, flags: *mut c_uint) -> BID128;
187  fn __bid128_acos(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
188  fn __bid128_acosh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
189  fn __bid128_add(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
190  fn __bid128_asin(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
191  fn __bid128_asinh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
192  fn __bid128_atan(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
193  fn __bid128_atan2(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
194  fn __bid128_atanh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
195  fn __bid128_cbrt(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
196  fn __bid128_copy(x: BID128) -> BID128;
197  fn __bid128_copySign(x: BID128, y: BID128) -> BID128;
198  fn __bid128_cos(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
199  fn __bid128_cosh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
200  fn __bid128_class(x: BID128) -> c_int;
201  fn __bid128_div(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
202  fn __bid128_exp(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
203  fn __bid128_exp10(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
204  fn __bid128_exp2(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
205  fn __bid128_expm1(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
206  fn __bid128_erf(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
207  fn __bid128_erfc(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
208  fn __bid128_fdim(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
209  fn __bid128_fma(x: BID128, y: BID128, z: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
210  fn __bid128_fmod(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
211  fn __bid128_frexp(x: BID128, exp: *mut c_int) -> BID128;
212  fn __bid128_from_int32(x: c_int) -> BID128;
213  fn __bid128_from_int64(x: c_longlong) -> BID128;
214  fn __bid128_from_string(s: *const c_char, round: c_uint, flags: *mut c_uint) -> BID128;
215  fn __bid128_from_uint32(x: c_uint) -> BID128;
216  fn __bid128_from_uint64(x: c_ulonglong) -> BID128;
217  fn __bid128_hypot(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
218  fn __bid128_ilogb(x: BID128, flags: *mut c_uint) -> c_int;
219  fn __bid128_inf() -> BID128;
220  fn __bid128_isCanonical(x: BID128) -> c_int;
221  fn __bid128_isFinite(x: BID128) -> c_int;
222  fn __bid128_isInf(x: BID128) -> c_int;
223  fn __bid128_isNaN(x: BID128) -> c_int;
224  fn __bid128_isNormal(x: BID128) -> c_int;
225  fn __bid128_isSignaling(x: BID128) -> c_int;
226  fn __bid128_isSigned(x: BID128) -> c_int;
227  fn __bid128_isSubnormal(x: BID128) -> c_int;
228  fn __bid128_isZero(x: BID128) -> c_int;
229  fn __bid128_ldexp(x: BID128, n: c_int, round: c_uint, flags: *mut c_uint) -> BID128;
230  fn __bid128_lgamma(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
231  fn __bid128_llrint(x: BID128, round: c_uint, flags: *mut c_uint) -> c_longlong;
232  fn __bid128_llround(x: BID128, flags: *mut c_uint) -> c_longlong;
233  fn __bid128_llquantexp(x: BID128) -> c_longlong;
234  fn __bid128_log(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
235  fn __bid128_log10(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
236  fn __bid128_log1p(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
237  fn __bid128_log2(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
238  fn __bid128_logb(x: BID128, flags: *mut c_uint) -> BID128;
239  fn __bid128_lrint(x: BID128, round: c_uint, flags: *mut c_uint) -> c_long;
240  fn __bid128_lround(x: BID128, flags: *mut c_uint) -> c_long;
241  fn __bid128_maxnum(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
242  fn __bid128_maxnum_mag(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
243  fn __bid128_minnum(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
244  fn __bid128_minnum_mag(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
245  fn __bid128_modf(x: BID128, int: *mut BID128, flags: *mut c_uint) -> BID128;
246  fn __bid128_mul(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
247  fn __bid128_nan(s: *const c_char) -> BID128;
248  fn __bid128_nearbyint(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
249  fn __bid128_nextafter(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
250  fn __bid128_nextdown(x: BID128, flags: *mut c_uint) -> BID128;
251  fn __bid128_nexttoward(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
252  fn __bid128_nextup(x: BID128, flags: *mut c_uint) -> BID128;
253  fn __bid128_negate(x: BID128) -> BID128;
254  fn __bid128_pow(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
255  fn __bid128_quantexp(x: BID128) -> c_int;
256  fn __bid128_quantum(x: BID128) -> BID128;
257  fn __bid128_quantize(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
258  fn __bid128_quiet_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
259  fn __bid128_quiet_greater(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
260  fn __bid128_quiet_greater_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
261  fn __bid128_quiet_greater_unordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
262  fn __bid128_quiet_less(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
263  fn __bid128_quiet_less_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
264  fn __bid128_quiet_less_unordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
265  fn __bid128_quiet_not_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
266  fn __bid128_quiet_not_greater(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
267  fn __bid128_quiet_not_less(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
268  fn __bid128_quiet_ordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
269  fn __bid128_quiet_unordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
270  fn __bid128_radix(x: BID128) -> c_int;
271  fn __bid128_rem(x: BID128, y: BID128, flags: *mut c_uint) -> BID128;
272  fn __bid128_round_integral_exact(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
273  fn __bid128_round_integral_nearest_away(x: BID128, flags: *mut c_uint) -> BID128;
274  fn __bid128_round_integral_nearest_even(x: BID128, flags: *mut c_uint) -> BID128;
275  fn __bid128_round_integral_negative(x: BID128, flags: *mut c_uint) -> BID128;
276  fn __bid128_round_integral_positive(x: BID128, flags: *mut c_uint) -> BID128;
277  fn __bid128_round_integral_zero(x: BID128, flags: *mut c_uint) -> BID128;
278  fn __bid128_sameQuantum(x: BID128, y: BID128) -> c_int;
279  fn __bid128_scalbn(x: BID128, n: c_int) -> BID128;
280  fn __bid128_scalbln(x: BID128, n: c_long) -> BID128;
281  fn __bid128_signaling_greater(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
282  fn __bid128_signaling_greater_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
283  fn __bid128_signaling_greater_unordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
284  fn __bid128_signaling_less(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
285  fn __bid128_signaling_less_equal(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
286  fn __bid128_signaling_less_unordered(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
287  fn __bid128_signaling_not_greater(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
288  fn __bid128_signaling_not_less(x: BID128, y: BID128, flags: *mut c_uint) -> c_int;
289  fn __bid128_sin(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
290  fn __bid128_sinh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
291  fn __bid128_sqrt(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
292  fn __bid128_sub(x: BID128, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
293  fn __bid128_tan(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
294  fn __bid128_tanh(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
295  fn __bid128_tgamma(x: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
296  fn __bid128_to_bid32(x: BID128, round: c_uint, flags: *mut c_uint) -> BID32;
297  fn __bid128_to_bid64(x: BID128, round: c_uint, flags: *mut c_uint) -> BID64;
298  fn __bid128_to_binary32(x: BID128, round: c_uint, flags: *mut c_uint) -> c_float;
299  fn __bid128_to_binary64(x: BID128, round: c_uint, flags: *mut c_uint) -> c_double;
300  fn __bid128_to_int16_ceil(x: BID128, flags: *mut c_uint) -> c_short;
301  fn __bid128_to_int16_floor(x: BID128, flags: *mut c_uint) -> c_short;
302  fn __bid128_to_int16_int(x: BID128, flags: *mut c_uint) -> c_short;
303  fn __bid128_to_int16_rnint(x: BID128, flags: *mut c_uint) -> c_short;
304  fn __bid128_to_int16_rninta(x: BID128, flags: *mut c_uint) -> c_short;
305  fn __bid128_to_int16_xceil(x: BID128, flags: *mut c_uint) -> c_short;
306  fn __bid128_to_int16_xfloor(x: BID128, flags: *mut c_uint) -> c_short;
307  fn __bid128_to_int16_xint(x: BID128, flags: *mut c_uint) -> c_short;
308  fn __bid128_to_int16_xrnint(x: BID128, flags: *mut c_uint) -> c_short;
309  fn __bid128_to_int16_xrninta(x: BID128, flags: *mut c_uint) -> c_short;
310  fn __bid128_to_int32_ceil(x: BID128, flags: *mut c_uint) -> c_int;
311  fn __bid128_to_int32_floor(x: BID128, flags: *mut c_uint) -> c_int;
312  fn __bid128_to_int32_int(x: BID128, flags: *mut c_uint) -> c_int;
313  fn __bid128_to_int32_rnint(x: BID128, flags: *mut c_uint) -> c_int;
314  fn __bid128_to_int32_rninta(x: BID128, flags: *mut c_uint) -> c_int;
315  fn __bid128_to_int32_xceil(x: BID128, flags: *mut c_uint) -> c_int;
316  fn __bid128_to_int32_xfloor(x: BID128, flags: *mut c_uint) -> c_int;
317  fn __bid128_to_int32_xint(x: BID128, flags: *mut c_uint) -> c_int;
318  fn __bid128_to_int32_xrnint(x: BID128, flags: *mut c_uint) -> c_int;
319  fn __bid128_to_int32_xrninta(x: BID128, flags: *mut c_uint) -> c_int;
320  fn __bid128_to_int64_ceil(x: BID128, flags: *mut c_uint) -> c_longlong;
321  fn __bid128_to_int64_floor(x: BID128, flags: *mut c_uint) -> c_longlong;
322  fn __bid128_to_int64_int(x: BID128, flags: *mut c_uint) -> c_longlong;
323  fn __bid128_to_int64_rnint(x: BID128, flags: *mut c_uint) -> c_longlong;
324  fn __bid128_to_int64_rninta(x: BID128, flags: *mut c_uint) -> c_longlong;
325  fn __bid128_to_int64_xceil(x: BID128, flags: *mut c_uint) -> c_longlong;
326  fn __bid128_to_int64_xfloor(x: BID128, flags: *mut c_uint) -> c_longlong;
327  fn __bid128_to_int64_xint(x: BID128, flags: *mut c_uint) -> c_longlong;
328  fn __bid128_to_int64_xrnint(x: BID128, flags: *mut c_uint) -> c_longlong;
329  fn __bid128_to_int64_xrninta(x: BID128, flags: *mut c_uint) -> c_longlong;
330  fn __bid128_to_int8_ceil(x: BID128, flags: *mut c_uint) -> c_schar;
331  fn __bid128_to_int8_floor(x: BID128, flags: *mut c_uint) -> c_schar;
332  fn __bid128_to_int8_int(x: BID128, flags: *mut c_uint) -> c_schar;
333  fn __bid128_to_int8_rnint(x: BID128, flags: *mut c_uint) -> c_schar;
334  fn __bid128_to_int8_rninta(x: BID128, flags: *mut c_uint) -> c_schar;
335  fn __bid128_to_int8_xceil(x: BID128, flags: *mut c_uint) -> c_schar;
336  fn __bid128_to_int8_xfloor(x: BID128, flags: *mut c_uint) -> c_schar;
337  fn __bid128_to_int8_xint(x: BID128, flags: *mut c_uint) -> c_schar;
338  fn __bid128_to_int8_xrnint(x: BID128, flags: *mut c_uint) -> c_schar;
339  fn __bid128_to_int8_xrninta(x: BID128, flags: *mut c_uint) -> c_schar;
340  fn __bid128_to_uint16_ceil(x: BID128, flags: *mut c_uint) -> c_ushort;
341  fn __bid128_to_uint16_floor(x: BID128, flags: *mut c_uint) -> c_ushort;
342  fn __bid128_to_uint16_int(x: BID128, flags: *mut c_uint) -> c_ushort;
343  fn __bid128_to_uint16_rnint(x: BID128, flags: *mut c_uint) -> c_ushort;
344  fn __bid128_to_uint16_rninta(x: BID128, flags: *mut c_uint) -> c_ushort;
345  fn __bid128_to_uint16_xceil(x: BID128, flags: *mut c_uint) -> c_ushort;
346  fn __bid128_to_uint16_xfloor(x: BID128, flags: *mut c_uint) -> c_ushort;
347  fn __bid128_to_uint16_xint(x: BID128, flags: *mut c_uint) -> c_ushort;
348  fn __bid128_to_uint16_xrnint(x: BID128, flags: *mut c_uint) -> c_ushort;
349  fn __bid128_to_uint16_xrninta(x: BID128, flags: *mut c_uint) -> c_ushort;
350  fn __bid128_to_uint32_ceil(x: BID128, flags: *mut c_uint) -> c_uint;
351  fn __bid128_to_uint32_floor(x: BID128, flags: *mut c_uint) -> c_uint;
352  fn __bid128_to_uint32_int(x: BID128, flags: *mut c_uint) -> c_uint;
353  fn __bid128_to_uint32_rnint(x: BID128, flags: *mut c_uint) -> c_uint;
354  fn __bid128_to_uint32_rninta(x: BID128, flags: *mut c_uint) -> c_uint;
355  fn __bid128_to_uint32_xceil(x: BID128, flags: *mut c_uint) -> c_uint;
356  fn __bid128_to_uint32_xfloor(x: BID128, flags: *mut c_uint) -> c_uint;
357  fn __bid128_to_uint32_xint(x: BID128, flags: *mut c_uint) -> c_uint;
358  fn __bid128_to_uint32_xrnint(x: BID128, flags: *mut c_uint) -> c_uint;
359  fn __bid128_to_uint32_xrninta(x: BID128, flags: *mut c_uint) -> c_uint;
360  fn __bid128_to_uint64_ceil(x: BID128, flags: *mut c_uint) -> c_ulonglong;
361  fn __bid128_to_uint64_floor(x: BID128, flags: *mut c_uint) -> c_ulonglong;
362  fn __bid128_to_uint64_int(x: BID128, flags: *mut c_uint) -> c_ulonglong;
363  fn __bid128_to_uint64_rnint(x: BID128, flags: *mut c_uint) -> c_ulonglong;
364  fn __bid128_to_uint64_rninta(x: BID128, flags: *mut c_uint) -> c_ulonglong;
365  fn __bid128_to_uint64_xceil(x: BID128, flags: *mut c_uint) -> c_ulonglong;
366  fn __bid128_to_uint64_xfloor(x: BID128, flags: *mut c_uint) -> c_ulonglong;
367  fn __bid128_to_uint64_xint(x: BID128, flags: *mut c_uint) -> c_ulonglong;
368  fn __bid128_to_uint64_xrnint(x: BID128, flags: *mut c_uint) -> c_ulonglong;
369  fn __bid128_to_uint64_xrninta(x: BID128, flags: *mut c_uint) -> c_ulonglong;
370  fn __bid128_to_uint8_ceil(x: BID128, flags: *mut c_uint) -> c_uchar;
371  fn __bid128_to_uint8_floor(x: BID128, flags: *mut c_uint) -> c_uchar;
372  fn __bid128_to_uint8_int(x: BID128, flags: *mut c_uint) -> c_uchar;
373  fn __bid128_to_uint8_rnint(x: BID128, flags: *mut c_uint) -> c_uchar;
374  fn __bid128_to_uint8_rninta(x: BID128, flags: *mut c_uint) -> c_uchar;
375  fn __bid128_to_uint8_xceil(x: BID128, flags: *mut c_uint) -> c_uchar;
376  fn __bid128_to_uint8_xfloor(x: BID128, flags: *mut c_uint) -> c_uchar;
377  fn __bid128_to_uint8_xint(x: BID128, flags: *mut c_uint) -> c_uchar;
378  fn __bid128_to_uint8_xrnint(x: BID128, flags: *mut c_uint) -> c_uchar;
379  fn __bid128_to_uint8_xrninta(x: BID128, flags: *mut c_uint) -> c_uchar;
380  fn __bid128_to_string(s: *mut c_char, x: BID128, flags: *mut c_uint);
381  fn __bid128_totalOrder(x: BID128, y: BID128) -> c_int;
382  fn __bid128_totalOrderMag(x: BID128, y: BID128) -> c_int;
383  fn __bid128dd_add(x: BID64, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
384  fn __bid128dq_add(x: BID64, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
385  fn __bid128qd_add(x: BID128, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
386  fn __bid128dd_sub(x: BID64, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
387  fn __bid128dq_sub(x: BID64, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
388  fn __bid128qd_sub(x: BID128, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
389  fn __bid128dd_mul(x: BID64, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
390  fn __bid128dq_mul(x: BID64, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
391  fn __bid128qd_mul(x: BID128, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
392  fn __bid128dd_div(x: BID64, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
393  fn __bid128dq_div(x: BID64, y: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
394  fn __bid128qd_div(x: BID128, y: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
395  fn __bid128ddd_fma(x: BID64, y: BID64, z: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
396  fn __bid128ddq_fma(x: BID64, y: BID64, z: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
397  fn __bid128dqd_fma(x: BID64, y: BID128, z: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
398  fn __bid128dqq_fma(x: BID64, y: BID128, z: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
399  fn __bid128qdd_fma(x: BID128, y: BID64, z: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
400  fn __bid128qdq_fma(x: BID128, y: BID64, z: BID128, round: c_uint, flags: *mut c_uint) -> BID128;
401  fn __bid128qqd_fma(x: BID128, y: BID128, z: BID64, round: c_uint, flags: *mut c_uint) -> BID128;
402}
403
404/// Returns the absolute value of 128-bit decimal floating-point number.
405///
406/// # Examples
407///
408/// ```
409/// use dfp_number_sys::bid128_000::*;
410/// use dfp_number_sys::EXE_CLEAR;
411///
412/// let x = bid128_from_int32(-2);
413/// let mut flags = EXE_CLEAR;
414/// let y = bid128_abs(x, &mut flags);
415/// assert_eq!(flags, EXE_CLEAR);
416/// assert_eq!("+2E+0", bid128_to_string(y, &mut flags));
417/// assert_eq!(flags, EXE_CLEAR);
418/// ```
419pub fn bid128_abs(x: BID128, flags: &mut ExcFlags) -> BID128 {
420  unsafe { __bid128_abs(x, flags) }
421}
422
423/// Returns `arcsin(x)`.
424pub fn bid128_acos(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
425  unsafe { __bid128_acos(x, round, flags) }
426}
427
428/// Returns `arsinh(x)`.
429pub fn bid128_acosh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
430  unsafe { __bid128_acosh(x, round, flags) }
431}
432
433/// Returns a result of decimal floating-point addition.
434pub fn bid128_add(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
435  unsafe { __bid128_add(x, y, round, flags) }
436}
437
438/// Returns `arcsin(x)`.
439pub fn bid128_asin(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
440  unsafe { __bid128_asin(x, round, flags) }
441}
442
443/// Returns `arsinh(x)`.
444pub fn bid128_asinh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
445  unsafe { __bid128_asinh(x, round, flags) }
446}
447
448/// Returns `arctan(x)`.
449pub fn bid128_atan(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
450  unsafe { __bid128_atan(x, round, flags) }
451}
452
453/// Returns `arctan2(x, y)`.
454pub fn bid128_atan2(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
455  unsafe { __bid128_atan2(x, y, round, flags) }
456}
457
458/// Returns `artanh(x)`.
459pub fn bid128_atanh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
460  unsafe { __bid128_atanh(x, round, flags) }
461}
462
463/// Returns the cube root of the argument `x`.
464pub fn bid128_cbrt(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
465  unsafe { __bid128_cbrt(x, round, flags) }
466}
467
468/// Copies a 128-bit decimal floating-point operand to a destination
469/// in the same format, with no change.
470pub fn bid128_copy(x: BID128) -> BID128 {
471  unsafe { __bid128_copy(x) }
472}
473
474/// Copies argument `x` to destination in the same format as `x`, but with the sign of `y`.
475pub fn bid128_copy_sign(x: BID128, y: BID128) -> BID128 {
476  unsafe { __bid128_copySign(x, y) }
477}
478
479/// Returns `cos(x)`.
480pub fn bid128_cos(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
481  unsafe { __bid128_cos(x, round, flags) }
482}
483
484/// Returns `cosh(x)`.
485pub fn bid128_cosh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
486  unsafe { __bid128_cosh(x, round, flags) }
487}
488
489/// Returns the class of the specified argument `x`.
490pub fn bid128_class(x: BID128) -> Class {
491  unsafe { __bid128_class(x) as u32 }.into()
492}
493
494/// Returns a result of decimal floating-point division.
495pub fn bid128_div(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
496  unsafe { __bid128_div(x, y, round, flags) }
497}
498
499/// Returns the result of Gaussian error function for specified `x`.
500pub fn bid128_erf(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
501  unsafe { __bid128_erf(x, round, flags) }
502}
503
504/// Returns the result of the complementary Gaussian error function for specified `x`: `erfc(x) = 1 - erf(x)`.
505pub fn bid128_erfc(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
506  unsafe { __bid128_erfc(x, round, flags) }
507}
508
509/// Returns the value of `e` raised to the `x`th power.
510pub fn bid128_exp(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
511  unsafe { __bid128_exp(x, round, flags) }
512}
513
514/// Returns the `10^x`.
515pub fn bid128_exp10(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
516  unsafe { __bid128_exp10(x, round, flags) }
517}
518
519/// Returns the `2^x`.
520pub fn bid128_exp2(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
521  unsafe { __bid128_exp2(x, round, flags) }
522}
523
524/// Returns the `e^x - 1`.
525pub fn bid128_expm1(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
526  unsafe { __bid128_expm1(x, round, flags) }
527}
528
529/// Returns positive difference between `x` and `y`.
530/// Result is x - y if x > y, and +0 is x <= y.
531pub fn bid128_fdim(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
532  unsafe { __bid128_fdim(x, y, round, flags) }
533}
534
535/// Returns `(x * y) + z` rounded as one ternary operation.
536pub fn bid128_fma(x: BID128, y: BID128, z: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
537  unsafe { __bid128_fma(x, y, z, round, flags) }
538}
539
540/// Returns the remainder of the division `x/y`.
541pub fn bid128_fmod(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
542  unsafe { __bid128_fmod(x, y, flags) }
543}
544
545/// If x is not a floating-point number, the results are unspecified (this
546/// implementation returns x and *exp = 0). Otherwise, the frexp function
547/// returns the value res, such that res has a magnitude in the interval
548/// [1/10, 1) or zero, and x = res*2^*exp. If x is zero, both parts of the
549/// result are zero. `frexp` does not raise any exceptions.
550pub fn bid128_frexp(x: BID128, exp: &mut i32) -> BID128 {
551  unsafe { __bid128_frexp(x, exp) }
552}
553
554/// Converts 32-bit signed integer to 128-bit decimal floating-point number.
555pub fn bid128_from_int32(x: i32) -> BID128 {
556  unsafe { __bid128_from_int32(x) }
557}
558
559/// Converts 64-bit signed integer to 128-bit decimal floating-point number.
560pub fn bid128_from_int64(x: i64) -> BID128 {
561  unsafe { __bid128_from_int64(x) }
562}
563
564/// Converts a decimal floating-point value represented in string format (decimal character sequence)
565/// to 128-bit decimal floating-point format (binary encoding).
566pub fn bid128_from_string(s: &str, round: RndMode, flags: &mut ExcFlags) -> BID128 {
567  let c_s = CString::new(s).unwrap();
568  unsafe { __bid128_from_string(c_s.as_ptr(), round, flags) }
569}
570
571/// Converts 32-bit unsigned integer to 128-bit decimal floating-point number.
572pub fn bid128_from_uint32(x: u32) -> BID128 {
573  unsafe { __bid128_from_uint32(x) }
574}
575
576/// Converts 64-bit unsigned integer to 128-bit decimal floating-point number.
577pub fn bid128_from_uint64(x: u64) -> BID128 {
578  unsafe { __bid128_from_uint64(x) }
579}
580
581/// Returns the square root of the squares of two arguments.
582pub fn bid128_hypot(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
583  unsafe { __bid128_hypot(x, y, round, flags) }
584}
585
586/// Returns the exponent e of x, a signed integral value, determined as though x
587/// were represented with infinite range and minimum exponent.
588pub fn bid128_ilogb(x: BID128, flags: &mut ExcFlags) -> Signed {
589  unsafe { __bid128_ilogb(x, flags) }
590}
591
592/// Returns `true` if and only if `x` is canonical number, infinity or NaN.
593pub fn bid128_is_canonical(x: BID128) -> bool {
594  unsafe { __bid128_isCanonical(x) != 0 }
595}
596
597/// Returns `true` if and only if `x` is zero, subnormal or normal (not infinite or NaN).
598pub fn bid128_is_finite(x: BID128) -> bool {
599  unsafe { __bid128_isFinite(x) != 0 }
600}
601
602/// Returns x with infinite value.
603pub fn bid128_infinite() -> BID128 {
604  unsafe { __bid128_inf() }
605}
606
607/// Returns `true` if x is infinite.
608pub fn bid128_is_infinite(x: BID128) -> bool {
609  unsafe { __bid128_isInf(x) != 0 }
610}
611
612/// Returns `true` if `x` is a `NaN`.
613pub fn bid128_is_nan(x: BID128) -> bool {
614  unsafe { __bid128_isNaN(x) != 0 }
615}
616
617/// Returns `true` if and only if `x` is normal (not zero, subnormal, infinite, or NaN).
618pub fn bid128_is_normal(x: BID128) -> bool {
619  unsafe { __bid128_isNormal(x) != 0 }
620}
621
622/// Returns `true` if and only if x has a negative sign.
623pub fn bid128_is_signaling(x: BID128) -> bool {
624  unsafe { __bid128_isSignaling(x) != 0 }
625}
626
627/// Returns `true` if and only if x has a negative sign.
628pub fn bid128_is_signed(x: BID128) -> bool {
629  unsafe { __bid128_isSigned(x) != 0 }
630}
631
632/// Returns `true` if and only if `x` is subnormal.
633pub fn bid128_is_subnormal(x: BID128) -> bool {
634  unsafe { __bid128_isSubnormal(x) != 0 }
635}
636
637/// Returns `true` if and only if `x` is `+0` or `-0`.
638pub fn bid128_is_zero(x: BID128) -> bool {
639  unsafe { __bid128_isZero(x) != 0 }
640}
641
642/// Returns `x*(10^n)`.
643pub fn bid128_ldexp(x: BID128, n: i32, round: RndMode, flags: &mut ExcFlags) -> BID128 {
644  unsafe { __bid128_ldexp(x, n, round, flags) }
645}
646
647/// Returns natural logarithm from gamma function.
648pub fn bid128_lgamma(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
649  unsafe { __bid128_lgamma(x, round, flags) }
650}
651
652/// Returns its argument `x` rounded to the nearest integer value of
653/// type [i64], rounding according to the provided rounding direction.
654pub fn bid128_llrint(x: BID128, round: RndMode, flags: &mut ExcFlags) -> LongLong {
655  unsafe { __bid128_llrint(x, round, flags) }
656}
657
658/// Returns its argument `x` rounded to the nearest integer value of
659/// type [i64], using rounding to nearest-away.
660pub fn bid128_llround(x: BID128, flags: &mut ExcFlags) -> LongLong {
661  unsafe { __bid128_llround(x, flags) }
662}
663
664/// Returns natural logarithm of `x`.
665pub fn bid128_log(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
666  unsafe { __bid128_log(x, round, flags) }
667}
668
669/// Returns base 10 logarithm of `x`.
670pub fn bid128_log10(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
671  unsafe { __bid128_log10(x, round, flags) }
672}
673
674/// Returns natural logarithm of `1 + x`.
675pub fn bid128_log1p(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
676  unsafe { __bid128_log1p(x, round, flags) }
677}
678
679/// Returns base 2 logarithm of `x`.
680pub fn bid128_log2(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
681  unsafe { __bid128_log2(x, round, flags) }
682}
683
684/// Returns the unbiased radix-independent exponent from `x`.
685pub fn bid128_logb(x: BID128, flags: &mut ExcFlags) -> BID128 {
686  unsafe { __bid128_logb(x, flags) }
687}
688
689/// Returns its argument `x` rounded to the nearest integer value,
690/// rounding according to the provided rounding direction.
691pub fn bid128_lrint(x: BID128, round: RndMode, flags: &mut ExcFlags) -> Long {
692  unsafe { __bid128_lrint(x, round, flags) }
693}
694
695/// Returns its argument `x` rounded to the nearest integer value,
696/// using rounding to nearest-away.
697pub fn bid128_lround(x: BID128, flags: &mut ExcFlags) -> Long {
698  unsafe { __bid128_lround(x, flags) }
699}
700
701/// Returns the canonicalized floating-point number y if x < y,
702/// x if y < x, the canonicalized floating-point number if one operand
703/// is a floating-point number and the other a quiet NaN.
704/// Otherwise, it is either x or y, canonicalized.
705pub fn bid128_max_num(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
706  unsafe { __bid128_maxnum(x, y, flags) }
707}
708
709pub fn bid128_max_num_mag(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
710  unsafe { __bid128_maxnum_mag(x, y, flags) }
711}
712
713/// Returns the canonicalized floating-point number x if x < y,
714/// y if y < x, the canonicalized floating-point number if one operand
715/// is a floating-point number and the other a quiet NaN.
716/// Otherwise, it is either x or y, canonicalized.
717pub fn bid128_min_num(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
718  unsafe { __bid128_minnum(x, y, flags) }
719}
720
721pub fn bid128_min_num_mag(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
722  unsafe { __bid128_minnum_mag(x, y, flags) }
723}
724
725/// Splits the number `x` into integral and fractional part.
726pub fn bid128_modf(x: BID128, int: &mut BID128, flags: &mut ExcFlags) -> BID128 {
727  unsafe { __bid128_modf(x, int, flags) }
728}
729
730/// Returns a result of decimal floating-point multiplication.
731pub fn bid128_mul(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
732  unsafe { __bid128_mul(x, y, round, flags) }
733}
734
735/// Returns `NaN` with payload.
736pub fn bid128_nan(s: &str) -> BID128 {
737  let cstring = CString::new(s).unwrap();
738  unsafe { __bid128_nan(cstring.as_ptr()) }
739}
740
741pub fn bid128_nearbyint(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
742  unsafe { __bid128_nearbyint(x, round, flags) }
743}
744
745pub fn bid128_nextafter(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
746  unsafe { __bid128_nextafter(x, y, flags) }
747}
748
749pub fn bid128_nextdown(x: BID128, flags: &mut ExcFlags) -> BID128 {
750  unsafe { __bid128_nextdown(x, flags) }
751}
752
753pub fn bid128_nexttoward(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
754  unsafe { __bid128_nexttoward(x, y, flags) }
755}
756
757pub fn bid128_nextup(x: BID128, flags: &mut ExcFlags) -> BID128 {
758  unsafe { __bid128_nextup(x, flags) }
759}
760
761/// Returns the same value as `x` but with reversed sign.
762pub fn bid128_negate(x: BID128) -> BID128 {
763  unsafe { __bid128_negate(x) }
764}
765
766/// Returns decimal floating-point power.
767pub fn bid128_pow(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
768  unsafe { __bid128_pow(x, y, round, flags) }
769}
770
771/// Returns the quantum of a finite argument as a signed integer value.
772pub fn bid128_quantexp(x: BID128) -> Signed {
773  unsafe { __bid128_quantexp(x) }
774}
775
776/// Returns the quantum of a finite argument as a signed long long integer value.
777pub fn bid128_llquantexp(x: BID128) -> LongLong {
778  unsafe { __bid128_llquantexp(x) }
779}
780
781/// Returns the quantum of a finite argument.
782/// If x is infinite, the result is +Inf. If x is NaN, the result is NaN.
783pub fn bid128_quantum(x: BID128) -> BID128 {
784  unsafe { __bid128_quantum(x) }
785}
786
787/// Returns the number which is equal in value (except for any rounding) and sign
788/// to the first (left-hand) operand and which has an exponent set to be equal
789/// to the exponent of the second (right-hand) operand.
790pub fn bid128_quantize(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
791  unsafe { __bid128_quantize(x, y, round, flags) }
792}
793
794/// Compares 128-bit decimal floating-point numbers for specified relation,
795/// does not signal invalid exception for quiet NaNs.
796pub fn bid128_quiet_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
797  unsafe { __bid128_quiet_equal(x, y, flags) != 0 }
798}
799
800/// Compares 128-bit decimal floating-point numbers for specified relation,
801/// does not signal invalid exception for quiet NaNs.
802pub fn bid128_quiet_greater(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
803  unsafe { __bid128_quiet_greater(x, y, flags) != 0 }
804}
805
806/// Compares 128-bit decimal floating-point numbers for specified relation,
807/// does not signal invalid exception for quiet NaNs.
808pub fn bid128_quiet_greater_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
809  unsafe { __bid128_quiet_greater_equal(x, y, flags) != 0 }
810}
811
812pub fn bid128_quiet_greater_unordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
813  unsafe { __bid128_quiet_greater_unordered(x, y, flags) != 0 }
814}
815
816/// Compares 128-bit decimal floating-point numbers for specified relation,
817/// does not signal invalid exception for quiet NaNs.
818pub fn bid128_quiet_less(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
819  unsafe { __bid128_quiet_less(x, y, flags) != 0 }
820}
821
822/// Compares 128-bit decimal floating-point numbers for specified relation,
823/// does not signal invalid exception for quiet NaNs.
824pub fn bid128_quiet_less_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
825  unsafe { __bid128_quiet_less_equal(x, y, flags) != 0 }
826}
827
828pub fn bid128_quiet_less_unordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
829  unsafe { __bid128_quiet_less_unordered(x, y, flags) != 0 }
830}
831
832pub fn bid128_quiet_not_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
833  unsafe { __bid128_quiet_not_equal(x, y, flags) != 0 }
834}
835
836pub fn bid128_quiet_not_greater(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
837  unsafe { __bid128_quiet_not_greater(x, y, flags) != 0 }
838}
839
840pub fn bid128_quiet_not_less(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
841  unsafe { __bid128_quiet_not_less(x, y, flags) != 0 }
842}
843
844pub fn bid128_quiet_ordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
845  unsafe { __bid128_quiet_ordered(x, y, flags) != 0 }
846}
847
848pub fn bid128_quiet_unordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
849  unsafe { __bid128_quiet_unordered(x, y, flags) != 0 }
850}
851
852pub fn bid128_radix(x: BID128) -> Signed {
853  unsafe { __bid128_radix(x) }
854}
855
856/// Returns decimal floating-point remainder.
857pub fn bid128_rem(x: BID128, y: BID128, flags: &mut ExcFlags) -> BID128 {
858  unsafe { __bid128_rem(x, y, flags) }
859}
860
861/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
862/// in the same format, using the current rounding mode; signals inexact exceptions.
863pub fn bid128_round_integral_exact(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
864  unsafe { __bid128_round_integral_exact(x, round, flags) }
865}
866
867/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
868/// in the same format, using the **rounding-to-nearest-away** mode; does not signal inexact exceptions.
869pub fn bid128_round_integral_nearest_away(x: BID128, flags: &mut ExcFlags) -> BID128 {
870  unsafe { __bid128_round_integral_nearest_away(x, flags) }
871}
872
873/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
874/// in the same format, using the **rounding-to-nearest-even** mode; does not signal inexact exceptions.
875pub fn bid128_round_integral_nearest_even(x: BID128, flags: &mut ExcFlags) -> BID128 {
876  unsafe { __bid128_round_integral_nearest_even(x, flags) }
877}
878
879/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
880/// in the same format, using the **rounding-down** mode; does not signal inexact exceptions.
881pub fn bid128_round_integral_negative(x: BID128, flags: &mut ExcFlags) -> BID128 {
882  unsafe { __bid128_round_integral_negative(x, flags) }
883}
884
885/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
886/// in the same format, using the **rounding-up** mode; does not signal inexact exceptions.
887pub fn bid128_round_integral_positive(x: BID128, flags: &mut ExcFlags) -> BID128 {
888  unsafe { __bid128_round_integral_positive(x, flags) }
889}
890
891/// Rounds 128-bit decimal floating-point value to integral-valued decimal floating-point value
892/// in the same format, using the **rounding-to-zero** mode; does not signal inexact exceptions.
893pub fn bid128_round_integral_zero(x: BID128, flags: &mut ExcFlags) -> BID128 {
894  unsafe { __bid128_round_integral_zero(x, flags) }
895}
896
897pub fn bid128_same_quantum(x: BID128, y: BID128) -> bool {
898  unsafe { __bid128_sameQuantum(x, y) != 0 }
899}
900
901/// Returns `x * 10^n` where `n` is of type [i32].
902pub fn bid128_scalbn(x: BID128, n: i32) -> BID128 {
903  const MIN: i32 = -6176;
904  const MAX: i32 = 6144;
905  unsafe { __bid128_scalbn(x, n.clamp(MIN, MAX)) }
906}
907
908/// Returns `x * 10^n` where `n` is of type [Long].
909pub fn bid128_scalbln(x: BID128, n: Long) -> BID128 {
910  const MIN: Long = -6176;
911  const MAX: Long = 6144;
912  unsafe { __bid128_scalbln(x, n.clamp(MIN, MAX)) }
913}
914
915pub fn bid128_signaling_greater(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
916  unsafe { __bid128_signaling_greater(x, y, flags) != 0 }
917}
918
919pub fn bid128_signaling_greater_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
920  unsafe { __bid128_signaling_greater_equal(x, y, flags) != 0 }
921}
922
923pub fn bid128_signaling_greater_unordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
924  unsafe { __bid128_signaling_greater_unordered(x, y, flags) != 0 }
925}
926
927pub fn bid128_signaling_less(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
928  unsafe { __bid128_signaling_less(x, y, flags) != 0 }
929}
930
931pub fn bid128_signaling_less_equal(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
932  unsafe { __bid128_signaling_less_equal(x, y, flags) != 0 }
933}
934
935pub fn bid128_signaling_less_unordered(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
936  unsafe { __bid128_signaling_less_unordered(x, y, flags) != 0 }
937}
938
939pub fn bid128_signaling_not_greater(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
940  unsafe { __bid128_signaling_not_greater(x, y, flags) != 0 }
941}
942
943pub fn bid128_signaling_not_less(x: BID128, y: BID128, flags: &mut ExcFlags) -> bool {
944  unsafe { __bid128_signaling_not_less(x, y, flags) != 0 }
945}
946
947/// Returns `sin(x)`.
948pub fn bid128_sin(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
949  unsafe { __bid128_sin(x, round, flags) }
950}
951
952/// Returns `sinh(x)`.
953pub fn bid128_sinh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
954  unsafe { __bid128_sinh(x, round, flags) }
955}
956
957/// Returns decimal floating-point square root.
958pub fn bid128_sqrt(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
959  unsafe { __bid128_sqrt(x, round, flags) }
960}
961
962/// Returns a result of decimal floating-point subtraction.
963pub fn bid128_sub(x: BID128, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
964  unsafe { __bid128_sub(x, y, round, flags) }
965}
966
967/// Returns `tan(x)`.
968pub fn bid128_tan(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
969  unsafe { __bid128_tan(x, round, flags) }
970}
971
972/// Returns `tanh(x)`.
973pub fn bid128_tanh(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
974  unsafe { __bid128_tanh(x, round, flags) }
975}
976
977pub fn bid128_tgamma(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
978  unsafe { __bid128_tgamma(x, round, flags) }
979}
980
981pub fn bid128_to_bid32(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID32 {
982  unsafe { __bid128_to_bid32(x, round, flags) }
983}
984
985pub fn bid128_to_bid64(x: BID128, round: RndMode, flags: &mut ExcFlags) -> BID64 {
986  unsafe { __bid128_to_bid64(x, round, flags) }
987}
988
989pub fn bid128_to_binary32(x: BID128, round: RndMode, flags: &mut ExcFlags) -> Float {
990  unsafe { __bid128_to_binary32(x, round, flags) }
991}
992
993pub fn bid128_to_binary64(x: BID128, round: RndMode, flags: &mut ExcFlags) -> Double {
994  unsafe { __bid128_to_binary64(x, round, flags) }
995}
996
997pub fn bid128_to_int16_ceil(x: BID128, flags: &mut ExcFlags) -> i16 {
998  unsafe { __bid128_to_int16_ceil(x, flags) }
999}
1000
1001pub fn bid128_to_int16_floor(x: BID128, flags: &mut ExcFlags) -> i16 {
1002  unsafe { __bid128_to_int16_floor(x, flags) }
1003}
1004
1005pub fn bid128_to_int16_int(x: BID128, flags: &mut ExcFlags) -> i16 {
1006  unsafe { __bid128_to_int16_int(x, flags) }
1007}
1008
1009pub fn bid128_to_int16_rnint(x: BID128, flags: &mut ExcFlags) -> i16 {
1010  unsafe { __bid128_to_int16_rnint(x, flags) }
1011}
1012
1013pub fn bid128_to_int16_rninta(x: BID128, flags: &mut ExcFlags) -> i16 {
1014  unsafe { __bid128_to_int16_rninta(x, flags) }
1015}
1016
1017pub fn bid128_to_int16_xceil(x: BID128, flags: &mut ExcFlags) -> i16 {
1018  unsafe { __bid128_to_int16_xceil(x, flags) }
1019}
1020
1021pub fn bid128_to_int16_xfloor(x: BID128, flags: &mut ExcFlags) -> i16 {
1022  unsafe { __bid128_to_int16_xfloor(x, flags) }
1023}
1024
1025pub fn bid128_to_int16_xint(x: BID128, flags: &mut ExcFlags) -> i16 {
1026  unsafe { __bid128_to_int16_xint(x, flags) }
1027}
1028
1029pub fn bid128_to_int16_xrnint(x: BID128, flags: &mut ExcFlags) -> i16 {
1030  unsafe { __bid128_to_int16_xrnint(x, flags) }
1031}
1032
1033pub fn bid128_to_int16_xrninta(x: BID128, flags: &mut ExcFlags) -> i16 {
1034  unsafe { __bid128_to_int16_xrninta(x, flags) }
1035}
1036
1037pub fn bid128_to_int32_ceil(x: BID128, flags: &mut ExcFlags) -> i32 {
1038  unsafe { __bid128_to_int32_ceil(x, flags) }
1039}
1040
1041pub fn bid128_to_int32_floor(x: BID128, flags: &mut ExcFlags) -> i32 {
1042  unsafe { __bid128_to_int32_floor(x, flags) }
1043}
1044
1045pub fn bid128_to_int32_int(x: BID128, flags: &mut ExcFlags) -> i32 {
1046  unsafe { __bid128_to_int32_int(x, flags) }
1047}
1048
1049pub fn bid128_to_int32_rnint(x: BID128, flags: &mut ExcFlags) -> i32 {
1050  unsafe { __bid128_to_int32_rnint(x, flags) }
1051}
1052
1053pub fn bid128_to_int32_rninta(x: BID128, flags: &mut ExcFlags) -> i32 {
1054  unsafe { __bid128_to_int32_rninta(x, flags) }
1055}
1056
1057pub fn bid128_to_int32_xceil(x: BID128, flags: &mut ExcFlags) -> i32 {
1058  unsafe { __bid128_to_int32_xceil(x, flags) }
1059}
1060
1061pub fn bid128_to_int32_xfloor(x: BID128, flags: &mut ExcFlags) -> i32 {
1062  unsafe { __bid128_to_int32_xfloor(x, flags) }
1063}
1064
1065pub fn bid128_to_int32_xint(x: BID128, flags: &mut ExcFlags) -> i32 {
1066  unsafe { __bid128_to_int32_xint(x, flags) }
1067}
1068
1069pub fn bid128_to_int32_xrnint(x: BID128, flags: &mut ExcFlags) -> i32 {
1070  unsafe { __bid128_to_int32_xrnint(x, flags) }
1071}
1072
1073pub fn bid128_to_int32_xrninta(x: BID128, flags: &mut ExcFlags) -> i32 {
1074  unsafe { __bid128_to_int32_xrninta(x, flags) }
1075}
1076
1077pub fn bid128_to_int64_ceil(x: BID128, flags: &mut ExcFlags) -> i64 {
1078  unsafe { __bid128_to_int64_ceil(x, flags) }
1079}
1080
1081pub fn bid128_to_int64_floor(x: BID128, flags: &mut ExcFlags) -> i64 {
1082  unsafe { __bid128_to_int64_floor(x, flags) }
1083}
1084
1085pub fn bid128_to_int64_int(x: BID128, flags: &mut ExcFlags) -> i64 {
1086  unsafe { __bid128_to_int64_int(x, flags) }
1087}
1088
1089pub fn bid128_to_int64_rnint(x: BID128, flags: &mut ExcFlags) -> i64 {
1090  unsafe { __bid128_to_int64_rnint(x, flags) }
1091}
1092
1093pub fn bid128_to_int64_rninta(x: BID128, flags: &mut ExcFlags) -> i64 {
1094  unsafe { __bid128_to_int64_rninta(x, flags) }
1095}
1096
1097pub fn bid128_to_int64_xceil(x: BID128, flags: &mut ExcFlags) -> i64 {
1098  unsafe { __bid128_to_int64_xceil(x, flags) }
1099}
1100
1101pub fn bid128_to_int64_xfloor(x: BID128, flags: &mut ExcFlags) -> i64 {
1102  unsafe { __bid128_to_int64_xfloor(x, flags) }
1103}
1104
1105pub fn bid128_to_int64_xint(x: BID128, flags: &mut ExcFlags) -> i64 {
1106  unsafe { __bid128_to_int64_xint(x, flags) }
1107}
1108
1109pub fn bid128_to_int64_xrnint(x: BID128, flags: &mut ExcFlags) -> i64 {
1110  unsafe { __bid128_to_int64_xrnint(x, flags) }
1111}
1112
1113pub fn bid128_to_int64_xrninta(x: BID128, flags: &mut ExcFlags) -> i64 {
1114  unsafe { __bid128_to_int64_xrninta(x, flags) }
1115}
1116
1117pub fn bid128_to_int8_ceil(x: BID128, flags: &mut ExcFlags) -> i8 {
1118  unsafe { __bid128_to_int8_ceil(x, flags) }
1119}
1120
1121pub fn bid128_to_int8_floor(x: BID128, flags: &mut ExcFlags) -> i8 {
1122  unsafe { __bid128_to_int8_floor(x, flags) }
1123}
1124
1125pub fn bid128_to_int8_int(x: BID128, flags: &mut ExcFlags) -> i8 {
1126  unsafe { __bid128_to_int8_int(x, flags) }
1127}
1128
1129pub fn bid128_to_int8_rnint(x: BID128, flags: &mut ExcFlags) -> i8 {
1130  unsafe { __bid128_to_int8_rnint(x, flags) }
1131}
1132
1133pub fn bid128_to_int8_rninta(x: BID128, flags: &mut ExcFlags) -> i8 {
1134  unsafe { __bid128_to_int8_rninta(x, flags) }
1135}
1136
1137pub fn bid128_to_int8_xceil(x: BID128, flags: &mut ExcFlags) -> i8 {
1138  unsafe { __bid128_to_int8_xceil(x, flags) }
1139}
1140
1141pub fn bid128_to_int8_xfloor(x: BID128, flags: &mut ExcFlags) -> i8 {
1142  unsafe { __bid128_to_int8_xfloor(x, flags) }
1143}
1144
1145pub fn bid128_to_int8_xint(x: BID128, flags: &mut ExcFlags) -> i8 {
1146  unsafe { __bid128_to_int8_xint(x, flags) }
1147}
1148
1149pub fn bid128_to_int8_xrnint(x: BID128, flags: &mut ExcFlags) -> i8 {
1150  unsafe { __bid128_to_int8_xrnint(x, flags) }
1151}
1152
1153pub fn bid128_to_int8_xrninta(x: BID128, flags: &mut ExcFlags) -> i8 {
1154  unsafe { __bid128_to_int8_xrninta(x, flags) }
1155}
1156
1157pub fn bid128_to_uint16_ceil(x: BID128, flags: &mut ExcFlags) -> u16 {
1158  unsafe { __bid128_to_uint16_ceil(x, flags) }
1159}
1160
1161pub fn bid128_to_uint16_floor(x: BID128, flags: &mut ExcFlags) -> u16 {
1162  unsafe { __bid128_to_uint16_floor(x, flags) }
1163}
1164
1165pub fn bid128_to_uint16_int(x: BID128, flags: &mut ExcFlags) -> u16 {
1166  unsafe { __bid128_to_uint16_int(x, flags) }
1167}
1168
1169pub fn bid128_to_uint16_rnint(x: BID128, flags: &mut ExcFlags) -> u16 {
1170  unsafe { __bid128_to_uint16_rnint(x, flags) }
1171}
1172
1173pub fn bid128_to_uint16_rninta(x: BID128, flags: &mut ExcFlags) -> u16 {
1174  unsafe { __bid128_to_uint16_rninta(x, flags) }
1175}
1176
1177pub fn bid128_to_uint16_xceil(x: BID128, flags: &mut ExcFlags) -> u16 {
1178  unsafe { __bid128_to_uint16_xceil(x, flags) }
1179}
1180
1181pub fn bid128_to_uint16_xfloor(x: BID128, flags: &mut ExcFlags) -> u16 {
1182  unsafe { __bid128_to_uint16_xfloor(x, flags) }
1183}
1184
1185pub fn bid128_to_uint16_xint(x: BID128, flags: &mut ExcFlags) -> u16 {
1186  unsafe { __bid128_to_uint16_xint(x, flags) }
1187}
1188
1189pub fn bid128_to_uint16_xrnint(x: BID128, flags: &mut ExcFlags) -> u16 {
1190  unsafe { __bid128_to_uint16_xrnint(x, flags) }
1191}
1192
1193pub fn bid128_to_uint16_xrninta(x: BID128, flags: &mut ExcFlags) -> u16 {
1194  unsafe { __bid128_to_uint16_xrninta(x, flags) }
1195}
1196
1197pub fn bid128_to_uint32_ceil(x: BID128, flags: &mut ExcFlags) -> u32 {
1198  unsafe { __bid128_to_uint32_ceil(x, flags) }
1199}
1200
1201pub fn bid128_to_uint32_floor(x: BID128, flags: &mut ExcFlags) -> u32 {
1202  unsafe { __bid128_to_uint32_floor(x, flags) }
1203}
1204
1205pub fn bid128_to_uint32_int(x: BID128, flags: &mut ExcFlags) -> u32 {
1206  unsafe { __bid128_to_uint32_int(x, flags) }
1207}
1208
1209pub fn bid128_to_uint32_rnint(x: BID128, flags: &mut ExcFlags) -> u32 {
1210  unsafe { __bid128_to_uint32_rnint(x, flags) }
1211}
1212
1213pub fn bid128_to_uint32_rninta(x: BID128, flags: &mut ExcFlags) -> u32 {
1214  unsafe { __bid128_to_uint32_rninta(x, flags) }
1215}
1216
1217pub fn bid128_to_uint32_xceil(x: BID128, flags: &mut ExcFlags) -> u32 {
1218  unsafe { __bid128_to_uint32_xceil(x, flags) }
1219}
1220
1221pub fn bid128_to_uint32_xfloor(x: BID128, flags: &mut ExcFlags) -> u32 {
1222  unsafe { __bid128_to_uint32_xfloor(x, flags) }
1223}
1224
1225pub fn bid128_to_uint32_xint(x: BID128, flags: &mut ExcFlags) -> u32 {
1226  unsafe { __bid128_to_uint32_xint(x, flags) }
1227}
1228
1229pub fn bid128_to_uint32_xrnint(x: BID128, flags: &mut ExcFlags) -> u32 {
1230  unsafe { __bid128_to_uint32_xrnint(x, flags) }
1231}
1232
1233pub fn bid128_to_uint32_xrninta(x: BID128, flags: &mut ExcFlags) -> u32 {
1234  unsafe { __bid128_to_uint32_xrninta(x, flags) }
1235}
1236
1237pub fn bid128_to_uint64_ceil(x: BID128, flags: &mut ExcFlags) -> u64 {
1238  unsafe { __bid128_to_uint64_ceil(x, flags) }
1239}
1240
1241pub fn bid128_to_uint64_floor(x: BID128, flags: &mut ExcFlags) -> u64 {
1242  unsafe { __bid128_to_uint64_floor(x, flags) }
1243}
1244
1245pub fn bid128_to_uint64_int(x: BID128, flags: &mut ExcFlags) -> u64 {
1246  unsafe { __bid128_to_uint64_int(x, flags) }
1247}
1248
1249pub fn bid128_to_uint64_rnint(x: BID128, flags: &mut ExcFlags) -> u64 {
1250  unsafe { __bid128_to_uint64_rnint(x, flags) }
1251}
1252
1253pub fn bid128_to_uint64_rninta(x: BID128, flags: &mut ExcFlags) -> u64 {
1254  unsafe { __bid128_to_uint64_rninta(x, flags) }
1255}
1256
1257pub fn bid128_to_uint64_xceil(x: BID128, flags: &mut ExcFlags) -> u64 {
1258  unsafe { __bid128_to_uint64_xceil(x, flags) }
1259}
1260
1261pub fn bid128_to_uint64_xfloor(x: BID128, flags: &mut ExcFlags) -> u64 {
1262  unsafe { __bid128_to_uint64_xfloor(x, flags) }
1263}
1264
1265pub fn bid128_to_uint64_xint(x: BID128, flags: &mut ExcFlags) -> u64 {
1266  unsafe { __bid128_to_uint64_xint(x, flags) }
1267}
1268
1269pub fn bid128_to_uint64_xrnint(x: BID128, flags: &mut ExcFlags) -> u64 {
1270  unsafe { __bid128_to_uint64_xrnint(x, flags) }
1271}
1272
1273pub fn bid128_to_uint64_xrninta(x: BID128, flags: &mut ExcFlags) -> u64 {
1274  unsafe { __bid128_to_uint64_xrninta(x, flags) }
1275}
1276
1277pub fn bid128_to_uint8_ceil(x: BID128, flags: &mut ExcFlags) -> u8 {
1278  unsafe { __bid128_to_uint8_ceil(x, flags) }
1279}
1280
1281pub fn bid128_to_uint8_floor(x: BID128, flags: &mut ExcFlags) -> u8 {
1282  unsafe { __bid128_to_uint8_floor(x, flags) }
1283}
1284
1285pub fn bid128_to_uint8_int(x: BID128, flags: &mut ExcFlags) -> u8 {
1286  unsafe { __bid128_to_uint8_int(x, flags) }
1287}
1288
1289pub fn bid128_to_uint8_rnint(x: BID128, flags: &mut ExcFlags) -> u8 {
1290  unsafe { __bid128_to_uint8_rnint(x, flags) }
1291}
1292
1293pub fn bid128_to_uint8_rninta(x: BID128, flags: &mut ExcFlags) -> u8 {
1294  unsafe { __bid128_to_uint8_rninta(x, flags) }
1295}
1296
1297pub fn bid128_to_uint8_xceil(x: BID128, flags: &mut ExcFlags) -> u8 {
1298  unsafe { __bid128_to_uint8_xceil(x, flags) }
1299}
1300
1301pub fn bid128_to_uint8_xfloor(x: BID128, flags: &mut ExcFlags) -> u8 {
1302  unsafe { __bid128_to_uint8_xfloor(x, flags) }
1303}
1304
1305pub fn bid128_to_uint8_xint(x: BID128, flags: &mut ExcFlags) -> u8 {
1306  unsafe { __bid128_to_uint8_xint(x, flags) }
1307}
1308
1309pub fn bid128_to_uint8_xrnint(x: BID128, flags: &mut ExcFlags) -> u8 {
1310  unsafe { __bid128_to_uint8_xrnint(x, flags) }
1311}
1312
1313pub fn bid128_to_uint8_xrninta(x: BID128, flags: &mut ExcFlags) -> u8 {
1314  unsafe { __bid128_to_uint8_xrninta(x, flags) }
1315}
1316
1317/// Converts 128-bit decimal floating-point value (binary encoding)
1318/// to string format (decimal character sequence).
1319pub fn bid128_to_string(x: BID128, flags: &mut ExcFlags) -> String {
1320  let mut buf = [0_u8; 1024];
1321  unsafe {
1322    __bid128_to_string(buf.as_mut_ptr() as *mut c_char, x, flags);
1323    CStr::from_ptr(buf.as_ptr() as *const c_char).to_string_lossy().into_owned()
1324  }
1325}
1326
1327pub fn bid128_total_order(x: BID128, y: BID128) -> bool {
1328  unsafe { __bid128_totalOrder(x, y) != 0 }
1329}
1330
1331pub fn bid128_total_order_mag(x: BID128, y: BID128) -> bool {
1332  unsafe { __bid128_totalOrderMag(x, y) != 0 }
1333}
1334
1335pub fn bid128_add_dd(x: BID64, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1336  unsafe { __bid128dd_add(x, y, round, flags) }
1337}
1338
1339pub fn bid128_add_dq(x: BID64, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1340  unsafe { __bid128dq_add(x, y, round, flags) }
1341}
1342
1343pub fn bid128_add_qd(x: BID128, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1344  unsafe { __bid128qd_add(x, y, round, flags) }
1345}
1346
1347pub fn bid128_sub_dd(x: BID64, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1348  unsafe { __bid128dd_sub(x, y, round, flags) }
1349}
1350
1351pub fn bid128_sub_dq(x: BID64, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1352  unsafe { __bid128dq_sub(x, y, round, flags) }
1353}
1354
1355pub fn bid128_sub_qd(x: BID128, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1356  unsafe { __bid128qd_sub(x, y, round, flags) }
1357}
1358
1359pub fn bid128_mul_dd(x: BID64, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1360  unsafe { __bid128dd_mul(x, y, round, flags) }
1361}
1362
1363pub fn bid128_mul_dq(x: BID64, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1364  unsafe { __bid128dq_mul(x, y, round, flags) }
1365}
1366
1367pub fn bid128_mul_qd(x: BID128, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1368  unsafe { __bid128qd_mul(x, y, round, flags) }
1369}
1370
1371pub fn bid128_div_dd(x: BID64, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1372  unsafe { __bid128dd_div(x, y, round, flags) }
1373}
1374
1375pub fn bid128_div_dq(x: BID64, y: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1376  unsafe { __bid128dq_div(x, y, round, flags) }
1377}
1378
1379pub fn bid128_div_qd(x: BID128, y: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1380  unsafe { __bid128qd_div(x, y, round, flags) }
1381}
1382
1383pub fn bid128_fma_ddd(x: BID64, y: BID64, z: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1384  unsafe { __bid128ddd_fma(x, y, z, round, flags) }
1385}
1386
1387pub fn bid128_fma_ddq(x: BID64, y: BID64, z: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1388  unsafe { __bid128ddq_fma(x, y, z, round, flags) }
1389}
1390
1391pub fn bid128_fma_dqd(x: BID64, y: BID128, z: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1392  unsafe { __bid128dqd_fma(x, y, z, round, flags) }
1393}
1394
1395pub fn bid128_fma_dqq(x: BID64, y: BID128, z: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1396  unsafe { __bid128dqq_fma(x, y, z, round, flags) }
1397}
1398
1399pub fn bid128_fma_qdd(x: BID128, y: BID64, z: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1400  unsafe { __bid128qdd_fma(x, y, z, round, flags) }
1401}
1402
1403pub fn bid128_fma_qdq(x: BID128, y: BID64, z: BID128, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1404  unsafe { __bid128qdq_fma(x, y, z, round, flags) }
1405}
1406
1407pub fn bid128_fma_qqd(x: BID128, y: BID128, z: BID64, round: RndMode, flags: &mut ExcFlags) -> BID128 {
1408  unsafe { __bid128qqd_fma(x, y, z, round, flags) }
1409}