Return to BSD News archive
Received: by minnie.vk1xwt.ampr.org with NNTP
id AA2209 ; Mon, 01 Mar 93 10:49:31 EST
Xref: sserve comp.unix.bsd:11539 comp.unix.xenix.sco:6779
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!ugle.unit.no!spurv.runit.sintef.no!flipper.pvv.unit.no!imf.unit.no!arnej
From: arnej@imf.unit.no (Arne Henrik Juul)
Newsgroups: comp.unix.bsd,comp.unix.xenix.sco
Subject: Re: 386BSD: cc1 got fatal signal 6
Date: 25 Feb 93 17:23:04
Organization: Norwegian Institute of Technology
Lines: 56
Message-ID: <ARNEJ.93Feb25172304@chanur.imf.unit.no>
References: <DERAADT.93Feb11012907@newt.newt.cuc.ab.ca> <C2EwAp.88K@sugar.neosoft.com>
<1993Feb16.215658.29848@runx.oz.au>
<1993Feb25.093706.26305@robobar.co.uk>
NNTP-Posting-Host: chanur.imf.unit.no
In-reply-to: steve@robobar.co.uk's message of Thu, 25 Feb 1993 09:37:06 GMT
In article <1993Feb25.093706.26305@robobar.co.uk> steve@robobar.co.uk (Steve Bleazard) writes:
> >
> >Suitably fudge constants have been posted several times, including once
> >by Karl.
> >
> I would be grateful if someone could either post or mail me the correct values.
> I missed the original posting. If you post them please crosspost to
> comp.unix.xenix.sco as users of the xenix port of gcc-2.3.3 will also be
> interested.
It seems that printf() is broken while sscanf and atof are OK.
Test program with (correct) constants:
#undef DBL_MIN
#define DBL_MIN 2.2250738585072014e-308
#undef DBL_MAX
#define DBL_MAX 1.7976931348623157e+308
#undef LDBL_MIN
#define LDBL_MIN 2.2250738585072014e-308L
#undef LDBL_MAX
#define LDBL_MAX 1.7976931348623157e+308L
extern int printf(const char *, ...);
extern void exit(int);
void main(int argc, char **argv)
{
union { double d; unsigned char c[8]; } u;
u.d = DBL_MIN ;
printf("u.d is %23.17e\n", u.d);
printf("Hex rep is %02x%02x%02x%02x%02x%02x%02x%02x\n\n",
u.c[7], u.c[6], u.c[5], u.c[4], u.c[3], u.c[2], u.c[1], u.c[0]);
u.d = LDBL_MIN ;
printf("u.d is %23.17e\n", u.d);
printf("Hex rep is %02x%02x%02x%02x%02x%02x%02x%02x\n\n",
u.c[7], u.c[6], u.c[5], u.c[4], u.c[3], u.c[2], u.c[1], u.c[0]);
u.d = DBL_MAX ;
printf("u.d is %23.17e\n", u.d);
printf("Hex rep is %02x%02x%02x%02x%02x%02x%02x%02x\n\n",
u.c[7], u.c[6], u.c[5], u.c[4], u.c[3], u.c[2], u.c[1], u.c[0]);
u.d = LDBL_MAX ;
printf("u.d is %23.17e\n", u.d);
printf("Hex rep is %02x%02x%02x%02x%02x%02x%02x%02x\n\n",
u.c[7], u.c[6], u.c[5], u.c[4], u.c[3], u.c[2], u.c[1], u.c[0]);
exit(0);
}