|
|
Choosing A Webhost: |
CVS: boost/boost/test floating_point_comparison.hpp, 1.27, 1.28: msg#00587lib.boost.cvs
Update of /cvsroot/boost/boost/boost/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14787 Modified Files: floating_point_comparison.hpp Log Message: guard numeric_limits access with is_specialized Index: floating_point_comparison.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/test/floating_point_comparison.hpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- floating_point_comparison.hpp 22 May 2006 17:39:43 -0000 1.27 +++ floating_point_comparison.hpp 28 Jul 2006 15:01:01 -0000 1.28 @@ -61,14 +61,16 @@ inline FPT safe_fpt_division( FPT f1, FPT f2 ) { - // Avoid overflow. - if( f2 < static_cast<FPT>(1) && f1 > f2 * (std::numeric_limits<FPT>::max)() ) - return (std::numeric_limits<FPT>::max)(); + if( std::numeric_limits<FPT>::is_specialized ) { + // Avoid overflow. + if( f2 < static_cast<FPT>(1) && f1 > f2 * (std::numeric_limits<FPT>::max)() ) + return (std::numeric_limits<FPT>::max)(); - // Avoid underflow. - if( f1 == static_cast<FPT>(0) || - f2 > static_cast<FPT>(1) && f1 < f2 * (std::numeric_limits<FPT>::min)() ) - return static_cast<FPT>(0); + // Avoid underflow. + if( f1 == static_cast<FPT>(0) || + f2 > static_cast<FPT>(1) && f1 < f2 * (std::numeric_limits<FPT>::min)() ) + return static_cast<FPT>(0); + } return f1/f2; } @@ -243,6 +245,9 @@ // Revision History : // // $Log$ +// Revision 1.28 2006/07/28 15:01:01 rogeeff +// guard numeric_limits access with is_specialized +// // Revision 1.27 2006/05/22 17:39:43 johnmaddock // Fix min/max guidelines violation. // ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS: boost/libs/spirit/example/intermediate/simple_xml actions.hpp, 1.2, 1.2.2.1 driver.cpp, 1.2, 1.2.2.1 tag.cpp, 1.2, 1.2.2.1 xml_g.hpp, 1.2, 1.2.2.1, Hartmut Kaiser |
|---|---|
| Next by Date: | CVS: boost/tools/jam index.html,1.1.2.1,1.1.2.2, Rene Rivera |
| Previous by Thread: | CVS: boost/libs/spirit/example/intermediate/simple_xml actions.hpp, 1.2, 1.2.2.1 driver.cpp, 1.2, 1.2.2.1 tag.cpp, 1.2, 1.2.2.1 xml_g.hpp, 1.2, 1.2.2.1, Hartmut Kaiser |
| Next by Thread: | CVS: boost/tools/jam index.html,1.1.2.1,1.1.2.2, Rene Rivera |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |