Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 92256 invoked from network); 2 Apr 2008 16:17:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 16:17:18 -0000 Received: (qmail 35676 invoked by uid 500); 2 Apr 2008 16:17:18 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 35660 invoked by uid 500); 2 Apr 2008 16:17:18 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 35644 invoked by uid 99); 2 Apr 2008 16:17:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 09:17:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 209.85.200.168 as permitted sender) Received: from [209.85.200.168] (HELO wf-out-1314.google.com) (209.85.200.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 16:16:36 +0000 Received: by wf-out-1314.google.com with SMTP id 27so2869993wfd.2 for ; Wed, 02 Apr 2008 09:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=xSFPFrg/yqsTjxdDnTeiogMkN5ret65nNSdX827ul0g=; b=nvrMdW7GB8hpCVFb6e0Haq08CJXi/4JevKXHfkmDwlY1CKMJkL40J1pj2I9b6kvdRfvjGqLRoUdbf112CmGtfONnAB9V9tJ/eWA85dltg8vBPQZb+qr1r/RoGaYZCmA3q+ZGFClQo8+xAlGQdqVEzUDNQK/IzAzO4s9/oe+EA4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=GRRAoHrKpylEgfs+ppPps5avp3pLKHm13GG9hWoA7bagiOIkrUSgEerWJTgPXUcDKeTpoFt7O7GrYAmiexeNFamw9ZUqbBaaQ/kEa/zG0ACit/7YeegcsihBMS6PPs0WS6AjBE9KbradocKKa5J8pueoYOlwf5Vn8UMYOnMWfHI= Received: by 10.142.229.4 with SMTP id b4mr6050960wfh.184.1207153004564; Wed, 02 Apr 2008 09:16:44 -0700 (PDT) Received: from localhost.localdomain ( [71.229.200.170]) by mx.google.com with ESMTPS id 32sm3414350wfc.3.2008.04.02.09.16.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Apr 2008 09:16:43 -0700 (PDT) Message-ID: <47F3B16A.5030802@roguewave.com> Date: Wed, 02 Apr 2008 10:16:42 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: [jira] Updated: (STDCXX-51) infinity, NaN formatted differently on different platforms References: <1415864444.1207076426176.JavaMail.jira@brutus> In-Reply-To: <1415864444.1207076426176.JavaMail.jira@brutus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org I'm looking at this patch now but it'd be good if someone else (especially Travis and/or Brad) could spend some time reviewing it too. The goal here is to eventually provide implementations for these functions (or similar) on all platforms. Thanks Martin Farid Zaripov (JIRA) wrote: > [ https://issues.apache.org/jira/browse/STDCXX-51?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] > > Farid Zaripov updated STDCXX-51: > -------------------------------- > > Attachment: num_put.diff > > The proposed patch attached. > > ChangeLog: > * src/num_put.cpp (__rw_isinfnan): New function to detect inf and nan values. > (__rw_isinf): New function to detect inf values. > (__rw_isneginf): New function to detect negative inf values. > (__rw_isnan): New function to detect nan values. > (__rw_isnegnan): New function to detect negative nan values. > (__rw_isqnan): New function to detect quiet nan values. > (__rw_issnan): New function to detect signaling nan values. > (__rw_fmat_infnan): New function to format inf and nan values. > (__rw_put_num): Use __rw_isinfnan() and __rw_fmat_infnan() to format inf and nan values. > >> infinity, NaN formatted differently on different platforms >> ---------------------------------------------------------- >> >> Key: STDCXX-51 >> URL: https://issues.apache.org/jira/browse/STDCXX-51 >> Project: C++ Standard Library >> Issue Type: Improvement >> Components: 22. Localization >> Affects Versions: 4.1.2 >> Environment: all >> Reporter: Martin Sebor >> Assignee: Farid Zaripov >> Priority: Minor >> Attachments: num_put.diff >> >> >> The output of the program below is different depending on the operating system it runs on. It should be the same (preferably like that on AIX). >> $ cat u.cpp && uname -sr && make u -r && ./u >> #include >> #include >> int main () >> { >> std::cout << std::numeric_limits::infinity () << '\n' >> << std::numeric_limits::quiet_NaN () << '\n' >> << std::numeric_limits::signaling_NaN () << '\n'; >> } >> SunOS 5.9 >> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -pthreads -D_RWSTD_USE_CONFIG -I/build/sebor/gcc-3.4.3-15s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -Wall -W -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long u.cpp >> gcc u.o -o u -pthreads -L/build/sebor/gcc-3.4.3-15s/lib -lstd15s -lsupc++ -lm >> rm u.o >> inf >> nan >> nan >> $ uname -vs && gmake u -r && ./u >> AIX 5 >> xlCcore_r -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/vacpp-7.0.0.3-15D/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -g -q64 -qtemplateregistry=u.ti u.cpp >> xlCcore_r u.o -o u -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -liconv -brtl -q64 -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/vacpp-7.0.0.3-15D/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -qtemplateregistry=u.ti -L/build/sebor/vacpp-7.0.0.3-15D/lib -lstd15D -lm >> rm u.o >> inf >> nanq >> nans >