From issues-return-1010-apmail-stdcxx-issues-archive=stdcxx.apache.org@stdcxx.apache.org Tue Apr 01 18:14:53 2008 Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 38227 invoked from network); 1 Apr 2008 18:14:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Apr 2008 18:14:53 -0000 Received: (qmail 63610 invoked by uid 500); 1 Apr 2008 18:14:52 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 63585 invoked by uid 500); 1 Apr 2008 18:14:52 -0000 Mailing-List: contact issues-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 issues@stdcxx.apache.org Received: (qmail 63575 invoked by uid 99); 1 Apr 2008 18:14:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 11:14:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 18:14:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AB252234C0B3 for ; Tue, 1 Apr 2008 11:12:27 -0700 (PDT) Message-ID: <1616266321.1207073547700.JavaMail.jira@brutus> Date: Tue, 1 Apr 2008 11:12:27 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Issue Comment Edited: (STDCXX-819) [_MSC_VER] Binary representation of the numeric_limits<>::quiet_NaN() and numeric_limits<>::signaling_NaN() is different from binary representation in native STL In-Reply-To: <1261689043.1207073184636.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584237#action_12584237 ] farid edited comment on STDCXX-819 at 4/1/08 11:11 AM: --------------------------------------------------------------- As a result the following program outputs the defferent results: {noformat} #include #include #include int main () { std::cout << _copysign (1., std::numeric_limits::quiet_NaN ()) << '\n'; std::cout << _copysign (1., -std::numeric_limits::quiet_NaN ()) << '\n'; std::cout << _copysign (1., std::numeric_limits::signaling_NaN ()) << '\n'; std::cout << _copysign (1., -std::numeric_limits::signaling_NaN ()) << '\n'; return 0; } {noformat} The result in MSVC STL: {noformat} 1 -1 1 -1 {noformat} The result in stdcxx: {noformat} -1 -1 1 1 {noformat} was (Author: farid): As a result the following program outputs the deffirent results: {noformat} #include #include #include int main () { std::cout << _copysign (1., std::numeric_limits::quiet_NaN ()) << '\n'; std::cout << _copysign (1., -std::numeric_limits::quiet_NaN ()) << '\n'; std::cout << _copysign (1., std::numeric_limits::signaling_NaN ()) << '\n'; std::cout << _copysign (1., -std::numeric_limits::signaling_NaN ()) << '\n'; return 0; } {noformat} The result in MSVC STL: {noformat} 1 -1 1 -1 {noformat} The result in stdcxx: {noformat} -1 -1 1 1 {noformat} > [_MSC_VER] Binary representation of the numeric_limits<>::quiet_NaN() and numeric_limits<>::signaling_NaN() is different from binary representation in native STL > ----------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: STDCXX-819 > URL: https://issues.apache.org/jira/browse/STDCXX-819 > Project: C++ Standard Library > Issue Type: Bug > Components: 26. Numerics > Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0 > Environment: MSVC and ICC/Windows > Reporter: Farid Zaripov > Fix For: 4.2.1 > > > The binary representation of NAN's in stdcxx: > {noformat} > #define _RWSTD_FLT_QNAN_BITS { 0, 0, '\xc0', '\xff' } > #define _RWSTD_FLT_SNAN_BITS { '\x1', 0, '\x80', '\x7f' } > #define _RWSTD_DBL_QNAN_BITS { 0, 0, 0, 0, 0, 0, '\xf8', '\xff' } > #define _RWSTD_DBL_SNAN_BITS { '\x1', 0, 0, 0, 0, 0, '\xf0', '\x7f' } > #define _RWSTD_LDBL_QNAN_BITS { 0, 0, 0, 0, 0, 0, '\xf8', '\xff' } > #define _RWSTD_LDBL_SNAN_BITS { '\x1', 0, 0, 0, 0, 0, '\xf0', '\x7f' } > {noformat} > The binary representation of the same things in MSVC STL: > {noformat} > #define _RWSTD_FLT_QNAN_BITS { 0, 0, '\xc0', '\x7f' } > #define _RWSTD_FLT_SNAN_BITS { '\x1', 0, '\xc0', '\x7f' } > #define _RWSTD_DBL_QNAN_BITS { 0, 0, 0, 0, 0, 0, '\xf8', '\x7f' } > #define _RWSTD_DBL_SNAN_BITS { '\x1', 0, 0, 0, 0, 0, '\xf8', '\x7f' } > #define _RWSTD_LDBL_QNAN_BITS { 0, 0, 0, 0, 0, 0, '\xf8', '\x7f' } > #define _RWSTD_LDBL_SNAN_BITS { '\x1', 0, 0, 0, 0, 0, '\xf8', '\x7f' } > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.