Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/math/tools/workaround.hpp @ 125:34e428693f5d vext
Vext -> Repoint
author | Chris Cannam |
---|---|
date | Thu, 14 Jun 2018 11:15:39 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 // Copyright (c) 2006-7 John Maddock |
Chris@16 | 2 // Use, modification and distribution are subject to the |
Chris@16 | 3 // Boost Software License, Version 1.0. (See accompanying file |
Chris@16 | 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 5 |
Chris@16 | 6 #ifndef BOOST_MATH_TOOLS_WORHAROUND_HPP |
Chris@16 | 7 #define BOOST_MATH_TOOLS_WORHAROUND_HPP |
Chris@16 | 8 |
Chris@16 | 9 #ifdef _MSC_VER |
Chris@16 | 10 #pragma once |
Chris@16 | 11 #endif |
Chris@16 | 12 |
Chris@16 | 13 #include <boost/math/tools/config.hpp> |
Chris@16 | 14 |
Chris@16 | 15 namespace boost{ namespace math{ namespace tools{ |
Chris@16 | 16 // |
Chris@16 | 17 // We call this short forwarding function so that we can work around a bug |
Chris@16 | 18 // on Darwin that causes std::fmod to return a NaN. The test case is: |
Chris@16 | 19 // std::fmod(1185.0L, 1.5L); |
Chris@16 | 20 // |
Chris@16 | 21 template <class T> |
Chris@16 | 22 inline T fmod_workaround(T a, T b) |
Chris@16 | 23 { |
Chris@16 | 24 BOOST_MATH_STD_USING |
Chris@16 | 25 return fmod(a, b); |
Chris@16 | 26 } |
Chris@16 | 27 #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) |
Chris@16 | 28 template <> |
Chris@16 | 29 inline long double fmod_workaround(long double a, long double b) |
Chris@16 | 30 { |
Chris@16 | 31 return ::fmodl(a, b); |
Chris@16 | 32 } |
Chris@16 | 33 #endif |
Chris@16 | 34 |
Chris@16 | 35 }}} // namespaces |
Chris@16 | 36 |
Chris@16 | 37 #endif // BOOST_MATH_TOOLS_WORHAROUND_HPP |
Chris@16 | 38 |