#define PACK(s,e,m) ((s) | ((e) << 23L) | (m))
/* the following deal with IEEE double-precision numbers */
-#define EXCESSD 1022
+#define EXCESSD 1022L
#define HIDDEND (1L << 20L)
#define EXPDBITS 11
-#define EXPDMASK 0x7FF
+#define EXPDMASK 0x7FFL
#define EXPD(fp) (((fp.l.upper) >> 20L) & 0x7FFL)
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
(fp.l.lower >> 22))
-#define MANTDMASK 0xFFFFF /* mask of upper part */
+#define MANTDMASK 0xFFFFFL /* mask of upper part */
/* the following deal with IEEE extended-precision numbers */
-#define EXCESSX 16382
+#define EXCESSX 16382L
#define HIDDENX (1L << 31L)
#define EXPXBITS 15
#define EXPXMASK 0x7FFF
#define EXPX(fp) (((fp.l.upper) >> 16) & EXPXMASK)
#define SIGNX(fp) ((fp.l.upper) & SIGNBIT)
-#define MANTXMASK 0x7FFFFFFF /* mask of upper part */
+#define MANTXMASK 0x7FFFFFFFL /* mask of upper part */
union double_long
{
/* convert int to double */
double
-__floatsidf (int a1)
+__floatsidf (long a1)
{
long sign = 0, exp = 31 + EXCESSD;
union double_long dl;
}
}
- while (a1 < 0x1000000)
+ while (a1 < 0x1000000L)
{
a1 <<= 4;
exp -= 4;
}
- while (a1 < 0x40000000)
+ while (a1 < 0x40000000L)
{
a1 <<= 1;
exp--;
/* convert int to float */
float
-__floatsisf (int l)
+__floatsisf (long l)
{
double foo = __floatsidf (l);
return foo;
mant >>= 1;
/* did the round overflow? */
- if (mant & 0xFF000000)
+ if (mant & 0xFF000000L)
{
mant >>= 1;
exp++;
}
/* convert double to int */
-int
+long
__fixdfsi (double a1)
{
register union double_long dl1;
if (exp > 0)
{
/* Return largest integer. */
- return SIGND (dl1) ? 0x80000000 : 0x7fffffff;
+ return SIGND (dl1) ? 0x80000000L : 0x7fffffffL;
}
if (exp <= -32)
}
/* convert float to int */
-int
+long
__fixsfsi (float a1)
{
double foo = a1;
We assume all numbers are normalized, don't do any rounding, etc. */
/* Prototypes for the above in case we use them. */
-double __floatsidf (int);
-float __floatsisf (int);
+double __floatsidf (long);
+float __floatsisf (long);
double __extendsfdf2 (float);
float __truncdfsf2 (double);
-int __fixdfsi (double);
-int __fixsfsi (float);
+long __fixdfsi (double);
+long __fixsfsi (float);
/* convert double to long double */
long double
/* convert an int to a long double */
long double
-__floatsixf (int l)
+__floatsixf (long l)
{
double foo = __floatsidf (l);
return foo;
}
/* convert a long double to an int */
-int
+long
__fixxfsi (long double ld)
{
- int foo = __fixdfsi ((double) ld);
+ long foo = __fixdfsi ((double) ld);
return foo;
}