Beispiel #1
0
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);
}
Beispiel #2
0
_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);
}
Beispiel #3
0
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);
}
Beispiel #4
0
_Decimal64
__bid_extendsddd2 (_Decimal32 x) {
  union decimal64 res;
  union decimal32 ux;

  ux.d = x;
  res.i = __bid32_to_bid64 (ux.i);
  return (res.d);
}
Beispiel #5
0
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);
}
Beispiel #6
0
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);
}
Beispiel #7
0
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);
}