ack/lang/cem/libcc/gen/ecvt.c

49 lines
736 B
C
Raw Normal View History

1987-03-31 10:45:53 +00:00
/* $Header$ */
1989-07-26 11:08:24 +00:00
1987-01-27 15:57:55 +00:00
#ifndef NOFLOAT
1988-08-10 09:14:43 +00:00
1989-07-26 11:08:24 +00:00
struct mantissa {
unsigned long h_32;
unsigned long l_32;
};
struct EXTEND {
short sign;
short exp;
struct mantissa mantissa;
#define m1 mantissa.h_32
#define m2 mantissa.l_32
};
extern char *_ext_str_cvt();
static char *
cvt(value, ndigit, decpt, sign, ecvtflag)
double value;
int ndigit, *decpt, *sign;
{
struct EXTEND e;
_dbl_ext_cvt(value, &e);
return _ext_str_cvt(&e, ndigit, decpt, sign, ecvtflag);
}
1987-01-27 15:57:55 +00:00
char *
ecvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{
1989-07-26 11:08:24 +00:00
1987-01-27 15:57:55 +00:00
return cvt(value, ndigit, decpt, sign, 1);
}
char *
fcvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{
return cvt(value, ndigit, decpt, sign, 0);
}
1989-07-26 11:08:24 +00:00
#endif NOFLOAT