From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23540 invoked by alias); 28 Jul 2008 11:51:54 -0000 Received: (qmail 23532 invoked by uid 22791); 28 Jul 2008 11:51:54 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 28 Jul 2008 11:51:35 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KNRGE-0006wu-GW for gcc@gcc.gnu.org; Mon, 28 Jul 2008 11:51:30 +0000 Received: from 139.85.239.127 ([139.85.239.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Jul 2008 11:51:30 +0000 Received: from ndbecker2 by 139.85.239.127 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Jul 2008 11:51:30 +0000 To: gcc@gcc.gnu.org From: Neal Becker Subject: Re: std::isfinite broken? Date: Mon, 28 Jul 2008 11:54:00 -0000 Message-ID: References: <488DB11B.7010304@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00572.txt.bz2 Paolo Carlini wrote: > Neal Becker wrote: >> gcc-4.3.0-8.x86_64 >> >> I have test code that does passes std::isfinite (x), yet if I print the >> values to std::cout the value printed is 'inf'. Is std::isfinite (x) >> broken? >> > Whatever bug it may have - it can, of course - std::isfinite returns an > *int*, therefore your statement seems at the very least rather weird. A > self-contained testcase is badly needed. > > Paolo. I found that compiling without -ffast-math would allow std::isfinite to work. Sorry if the statement was confusing. The code looks something like: [calculate x] if (not isfinite (x)) throw std::runtime_error ("blah")