From owner-freebsd-current Sat May 29 5:13:27 1999 Delivered-To: freebsd-current@freebsd.org Received: from cons.org (knight.cons.org [194.233.237.195]) by hub.freebsd.org (Postfix) with ESMTP id 5926214E09 for ; Sat, 29 May 1999 05:13:24 -0700 (PDT) (envelope-from cracauer@cons.org) Received: (from cracauer@localhost) by cons.org (8.8.8/8.7.3) id OAA04795; Sat, 29 May 1999 14:13:18 +0200 (CEST) Date: Sat, 29 May 1999 14:13:18 +0200 From: Martin Cracauer To: "Jordan K. Hubbard" Cc: current@FreeBSD.ORG Subject: FP exceptions broken (Re: Interesting bogons from last night's 4.0 snapshot.) Message-ID: <19990529141318.A4777@cons.org> References: <17751.927941299@zippy.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <17751.927941299@zippy.cdrom.com>; from Jordan K. Hubbard on Fri, May 28, 1999 at 06:28:19PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In <17751.927941299@zippy.cdrom.com>, Jordan K. Hubbard wrote: [...] > JFYI - don't want us getting *too* complacent with -current now, do we? :-) Floating point exceptions are also broken, they always behave like masked, even if you unmask some explicitly with fpsetmask(). Even worse, a wrong result is returned if an exception had to be thrown, while the result is right for masked exceptions. #include #include #include int main(void) { fpsetmask(0); fprintf(stderr, "I want no exception, but an exception value\n"); fprintf(stderr, "res: %g\n", atof("1.0") / atof("0.0")); fpsetmask(FP_X_INV|FP_X_DNML|FP_X_DZ|FP_X_OFL|FP_X_UFL); fprintf(stderr, "I want an exception. Or at least an exceptional value\n"); fprintf(stderr, "res: %g\n", atof("1.0") / atof("0.0")); fprintf(stderr, "I didn't get one!\n"); return 0; } output on -current: I want no exception, but an exception value res: Inf I want an exception. Or at least an exception value res: 1 I didn't get one! output on anything else: I want no exception, but an exception value res: Inf I want an exception. Or at least an exception value Floating point exception (core dumped) Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message