static void efloor(short unsigned int *x, short unsigned int *y, LDPARMS *ldp);
static void etoasc(short unsigned int *x, char *string, int ndigs, int outformat, LDPARMS *ldp);
+union uconv
+{
+ unsigned short pe;
+ long double d;
+};
+
#if LDBL_MANT_DIG == 24
static void e24toe(short unsigned int *pe, short unsigned int *y, LDPARMS *ldp);
#elif LDBL_MANT_DIG == 53
LDPARMS *ldp = &rnd;
char *outstr;
char outbuf[NDEC + MAX_EXP_DIGITS + 10];
+union uconv du;
+du.d = d;
orig_ndigits = ndigits;
rnd.rlast = -1;
}
#if LDBL_MANT_DIG == 24
-e24toe( (unsigned short *)&d, e, ldp );
+e24toe( &du.pe, e, ldp );
#elif LDBL_MANT_DIG == 53
-e53toe( (unsigned short *)&d, e, ldp );
+e53toe( &du.pe, e, ldp );
#elif LDBL_MANT_DIG == 64
-e64toe( (unsigned short *)&d, e, ldp );
+e64toe( &du.pe, e, ldp );
#else
-e113toe( (unsigned short *)&d, e, ldp );
+e113toe( &du.pe, e, ldp );
#endif
if( eisneg(e) )
rnd.rlast = -1;
rnd.rndprc = NBITS;
+union uconv du;
+du.d = *d;
#if LDBL_MANT_DIG == 24
-e24toe( (unsigned short *)d, e, ldp );
+e24toe( &du.pe, e, ldp );
#elif LDBL_MANT_DIG == 53
-e53toe( (unsigned short *)d, e, ldp );
+e53toe( &du.pe, e, ldp );
#elif LDBL_MANT_DIG == 64
-e64toe( (unsigned short *)d, e, ldp );
+e64toe( &du.pe, e, ldp );
#else
-e113toe( (unsigned short *)d, e, ldp );
+e113toe( &du.pe, e, ldp );
#endif
if( (e[NE-1] & 0x7fff) == 0x7fff )
long double _strtold (char *s, char **se)
{
- long double x;
+ union uconv x;
LDPARMS rnd;
LDPARMS *ldp = &rnd;
int lenldstr;
rnd.rlast = -1;
rnd.rndprc = NBITS;
- lenldstr = asctoeg( s, (unsigned short *)&x, LDBL_MANT_DIG, ldp );
+ lenldstr = asctoeg( s, &x.pe, LDBL_MANT_DIG, ldp );
if (se)
*se = s + lenldstr;
- return x;
+ return x.d;
}
#define REASONABLE_LEN 200