From commits-return-2908-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Mon May 12 15:00:58 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 19817 invoked from network); 12 May 2008 15:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2008 15:00:58 -0000 Received: (qmail 80985 invoked by uid 500); 12 May 2008 15:01:00 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 80959 invoked by uid 500); 12 May 2008 15:01:00 -0000 Mailing-List: contact commits-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 commits@stdcxx.apache.org Received: (qmail 80948 invoked by uid 99); 12 May 2008 15:01:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 08:01:00 -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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 15:00:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6EF7B2388A39; Mon, 12 May 2008 08:00:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r655509 - /stdcxx/trunk/tests/support/18.numeric.special.float.cpp Date: Mon, 12 May 2008 15:00:35 -0000 To: commits@stdcxx.apache.org From: faridz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080512150035.6EF7B2388A39@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: faridz Date: Mon May 12 08:00:35 2008 New Revision: 655509 URL: http://svn.apache.org/viewvc?rev=655509&view=rev Log: 2008-05-12 Farid Zaripov STDCXX-897 * tests/support/18.numeric.special.float.cpp [_MSC_VER] (_fpclass): Provide _fpclass() overloads for float and long double types, since the MSVC provides this function for double type only. (has_denorm): Add _MSC_VER in the list of platforms where denormalized value are present. Modified: stdcxx/trunk/tests/support/18.numeric.special.float.cpp Modified: stdcxx/trunk/tests/support/18.numeric.special.float.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/support/18.numeric.special.float.cpp?rev=655509&r1=655508&r2=655509&view=diff ============================================================================== --- stdcxx/trunk/tests/support/18.numeric.special.float.cpp (original) +++ stdcxx/trunk/tests/support/18.numeric.special.float.cpp Mon May 12 08:00:35 2008 @@ -157,6 +157,34 @@ /***********************************************************************/ +#ifdef _MSC_VER + +inline int _fpclass (float val) +{ + long lval = *_RWSTD_REINTERPRET_CAST (long*, &val); + + if (0 == (lval & 0x7FFFFFFF)) + return lval ? _FPCLASS_NZ : _FPCLASS_PZ; + + if (0 == (lval & 0x7F800000)) + return (lval & 0x80000000) ? _FPCLASS_ND : _FPCLASS_PD; + + if (0x7F800000 == (lval & 0x7FFFFFFF)) + return (lval & 0x80000000) ? _FPCLASS_NINF : _FPCLASS_PINF; + + if (0x7F800000 == (lval & 0x7F800000)) + return (lval & 0x00400000) ? _FPCLASS_QNAN : _FPCLASS_SNAN; + + return (lval & 0x80000000) ? _FPCLASS_NN : _FPCLASS_PN; +} + +inline int _fpclass (long double val) +{ + return _fpclass (double (val)); +} + +#endif + template void test_infinity (FloatT inf, FloatT max, const char *tname) { @@ -451,9 +479,10 @@ static std::float_denorm_style has_denorm () { -#if defined (_AIX) \ - || defined (__hpux) \ - || defined (__osf__) +#if defined (_AIX) \ + || defined (__hpux) \ + || defined (__osf__) \ + || defined (_MSC_VER) return std::denorm_present; #else return std::denorm_indeterminate; @@ -718,9 +747,10 @@ static std::float_denorm_style has_denorm () { -#if defined (_AIX) \ - || defined (__hpux) \ - || defined (__osf__) +#if defined (_AIX) \ + || defined (__hpux) \ + || defined (__osf__) \ + || defined (_MSC_VER) return std::denorm_present; #else return std::denorm_indeterminate; @@ -978,9 +1008,10 @@ static std::float_denorm_style has_denorm () { -#if defined (_AIX) \ - || defined (__hpux) \ - || defined (__osf__) +#if defined (_AIX) \ + || defined (__hpux) \ + || defined (__osf__) \ + || defined (_MSC_VER) return std::denorm_present; #else return std::denorm_indeterminate;