CMPtype __bid_gtsd2 (_Decimal32 x, _Decimal32 y) { CMPtype res; UINT64 x64, y64; union decimal32 ux, uy; ux.d = x; uy.d = y; x64 = __bid32_to_bid64 (ux.i); y64 = __bid32_to_bid64 (uy.i); res = __bid64_quiet_greater (x64, y64); return (res); }
_Decimal32 __bid_divsd3 (_Decimal32 x, _Decimal32 y) { UINT64 x64, y64, res64; union decimal32 ux, uy, res; ux.d = x; uy.d = y; x64 = __bid32_to_bid64 (ux.i); y64 = __bid32_to_bid64 (uy.i); res64 = __bid64_div (x64, y64); res.i = __bid64_to_bid32 (res64); return (res.d); }
CMPtype __bid_eqsd2 (_Decimal32 x, _Decimal32 y) { CMPtype res; UINT64 x64, y64; union decimal32 ux, uy; ux.d = x; uy.d = y; x64 = __bid32_to_bid64 (ux.i); y64 = __bid32_to_bid64 (uy.i); res = __bid64_quiet_equal (x64, y64); if (res == 0) res = 1; else res = 0; return (res); }
_Decimal64 __bid_extendsddd2 (_Decimal32 x) { union decimal64 res; union decimal32 ux; ux.d = x; res.i = __bid32_to_bid64 (ux.i); return (res.d); }
int isinfd32 (_Decimal32 x) { int res; UINT64 x64; union decimal32 ux; ux.d = x; x64 = __bid32_to_bid64 (ux.i); res = __bid64_isInf (x64); return (res); }
SItype __bid_fixsdsi (_Decimal32 x) { SItype res = 0xbaddbadd; UINT64 x64; union decimal32 ux; ux.d = x; x64 = __bid32_to_bid64 (ux.i); res = __bid64_to_int32_xint (x64); return (res); }
USItype __bid_fixunssdsi (_Decimal32 x) { USItype res = 0xbaddbadd; UINT64 x64; union decimal32 ux; ux.d = x; x64 = __bid32_to_bid64 (ux.i); res = __bid64_to_uint32_xint (x64); if (res == 0x80000000) res = 0; // for NaNs too return (res); }