From: kevinx AT tst DOT hk DOT super DOT net (Mr Kevin Yeung) Newsgroups: comp.lang.c,comp.os.msdos.djgpp Subject: Re: DJGPP failed library tests? Followup-To: comp.lang.c,comp.os.msdos.djgpp Date: 2 Nov 1997 16:35:16 GMT Organization: Hong Kong Supernet Lines: 35 Distribution: world Message-ID: <63ia44$hoo$1@tst.hk.super.net> References: <639vjh$dru$1 AT tst DOT hk DOT super DOT net> <63hrdf$mpt$1 AT tst DOT hk DOT super DOT net> NNTP-Posting-Host: is1.hk.super.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi guys, Sorry to follow up myself. I just found out if I hardcode the numbers in the assertion there won't be any failure. However, the following piece of code certainly failed: #include #include #include #include #include int main() { char buf[32]; double db; float fl; long double ld; assert(sprintf(buf, "%E|%.2f|%Lg", 1.1e20, -3.346, .02L) == 23); assert(strcmp(buf, "1.100000E+20|-3.35|0.02") == 0); assert(sscanf(buf, "%e|%lg|%Lf", &fl, &db, &ld) == 3); assert(fabs(fl - 1.1e20) / 1.1e20 < 4 * FLT_EPSILON); assert(fabs(db + 3.35) / 3.35 < 4 * DBL_EPSILON); assert(fabs(ld - 0.02) / 0.02 < 4 * LDBL_EPSILON); return(0); } It seems to be the problem of the string functions rather than that of the math functions. But the maths functions don't trap EDOM errors is for sure. -- Kevin Yeung Change x to y in email address for private correspondence