mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Changed long long to boost::long_long_type and unsigned long long to boost::ulong_long_type.
A couple of other typo corrections, to get the code compiling with g++ -pedantic. [SVN r44877]
This commit is contained in:
@@ -79,11 +79,11 @@ public:
|
||||
assign_large_int(c);
|
||||
}
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
RR(unsigned long long c)
|
||||
RR(boost::ulong_long_type c)
|
||||
{
|
||||
assign_large_int(c);
|
||||
}
|
||||
RR(long long c)
|
||||
RR(boost::long_long_type c)
|
||||
{
|
||||
assign_large_int(c);
|
||||
}
|
||||
@@ -115,8 +115,8 @@ public:
|
||||
RR& operator=(long c) { assign_large_int(c); return *this; }
|
||||
RR& operator=(unsigned long c) { assign_large_int(c); return *this; }
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
RR& operator=(long long c) { assign_large_int(c); return *this; }
|
||||
RR& operator=(unsigned long long c) { assign_large_int(c); return *this; }
|
||||
RR& operator=(boost::long_long_type c) { assign_large_int(c); return *this; }
|
||||
RR& operator=(boost::ulong_long_type c) { assign_large_int(c); return *this; }
|
||||
#endif
|
||||
RR& operator=(float c) { m_value = c; return *this; }
|
||||
RR& operator=(double c) { m_value = c; return *this; }
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace detail
|
||||
BOOST_PRIVATE_GCD_UF( unsigned long );
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
BOOST_PRIVATE_GCD_UF( unsigned long long );
|
||||
BOOST_PRIVATE_GCD_UF( boost::ulong_long_type );
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_PRIVATE_GCD_UF( unsigned __int64 );
|
||||
#endif
|
||||
@@ -325,7 +325,7 @@ namespace detail
|
||||
BOOST_PRIVATE_GCD_SF( char, unsigned char ); // should work even if unsigned
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
BOOST_PRIVATE_GCD_SF( long long, unsigned long long );
|
||||
BOOST_PRIVATE_GCD_SF( boost::long_long_type, boost::ulong_long_type );
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_PRIVATE_GCD_SF( __int64, unsigned __int64 );
|
||||
#endif
|
||||
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
real_concept(unsigned long c) : m_value(c){}
|
||||
real_concept(long c) : m_value(c){}
|
||||
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
|
||||
real_concept(unsigned long long c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
real_concept(long long c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
real_concept(boost::ulong_long_type c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
real_concept(boost::long_long_type c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
real_concept(unsigned __int64 c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
real_concept(__int64 c) : m_value(static_cast<real_concept_base_type>(c)){}
|
||||
@@ -91,8 +91,8 @@ public:
|
||||
real_concept& operator=(long c) { m_value = c; return *this; }
|
||||
real_concept& operator=(unsigned long c) { m_value = c; return *this; }
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
real_concept& operator=(long long c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
|
||||
real_concept& operator=(unsigned long long c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
|
||||
real_concept& operator=(boost::long_long_type c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
|
||||
real_concept& operator=(boost::ulong_long_type c) { m_value = static_cast<real_concept_base_type>(c); return *this; }
|
||||
#endif
|
||||
real_concept& operator=(float c) { m_value = c; return *this; }
|
||||
real_concept& operator=(double c) { m_value = c; return *this; }
|
||||
@@ -253,9 +253,9 @@ inline long lround(const concepts::real_concept& v)
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class Policy>
|
||||
inline long long llround(const concepts::real_concept& v, const Policy& pol)
|
||||
inline boost::long_long_type llround(const concepts::real_concept& v, const Policy& pol)
|
||||
{ return boost::math::llround(v.value(), pol); }
|
||||
inline long long llround(const concepts::real_concept& v)
|
||||
inline boost::long_long_type llround(const concepts::real_concept& v)
|
||||
{ return boost::math::llround(v.value(), policies::policy<>()); }
|
||||
#endif
|
||||
|
||||
@@ -272,9 +272,9 @@ inline long ltrunc(const concepts::real_concept& v)
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class Policy>
|
||||
inline long long lltrunc(const concepts::real_concept& v, const Policy& pol)
|
||||
inline boost::long_long_type lltrunc(const concepts::real_concept& v, const Policy& pol)
|
||||
{ return boost::math::lltrunc(v.value(), pol); }
|
||||
inline long long lltrunc(const concepts::real_concept& v)
|
||||
inline boost::long_long_type lltrunc(const concepts::real_concept& v)
|
||||
{ return boost::math::lltrunc(v.value(), policies::policy<>()); }
|
||||
#endif
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
std_real_concept(unsigned long c) : m_value(c){}
|
||||
std_real_concept(long c) : m_value(c){}
|
||||
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
|
||||
std_real_concept(unsigned long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
std_real_concept(long long c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
std_real_concept(boost::ulong_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
std_real_concept(boost::long_long_type c) : m_value(static_cast<std_real_concept_base_type>(c)){}
|
||||
#endif
|
||||
std_real_concept(float c) : m_value(c){}
|
||||
std_real_concept(double c) : m_value(c){}
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
std_real_concept& operator=(long c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(unsigned long c) { m_value = c; return *this; }
|
||||
#if defined(BOOST_HAS_LONG_LONG) || defined(__DECCXX) || defined(__SUNPRO_CC)
|
||||
std_real_concept& operator=(long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
std_real_concept& operator=(unsigned long long c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
std_real_concept& operator=(boost::long_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
std_real_concept& operator=(boost::ulong_long_type c) { m_value = static_cast<std_real_concept_base_type>(c); return *this; }
|
||||
#endif
|
||||
std_real_concept& operator=(float c) { m_value = c; return *this; }
|
||||
std_real_concept& operator=(double c) { m_value = c; return *this; }
|
||||
@@ -249,11 +249,11 @@ inline long lround(const concepts::std_real_concept& v)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class Policy>
|
||||
inline long long llround(const concepts::std_real_concept& v, const Policy& pol)
|
||||
inline boost::long_long_type llround(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::llround(v.value(), pol);
|
||||
}
|
||||
inline long long llround(const concepts::std_real_concept& v)
|
||||
inline boost::long_long_type llround(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::llround(v.value(), policies::policy<>());
|
||||
}
|
||||
@@ -283,11 +283,11 @@ inline long ltrunc(const concepts::std_real_concept& v)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class Policy>
|
||||
inline long long lltrunc(const concepts::std_real_concept& v, const Policy& pol)
|
||||
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v, const Policy& pol)
|
||||
{
|
||||
return boost::math::lltrunc(v.value(), pol);
|
||||
}
|
||||
inline long long lltrunc(const concepts::std_real_concept& v)
|
||||
inline boost::long_long_type lltrunc(const concepts::std_real_concept& v)
|
||||
{
|
||||
return boost::math::lltrunc(v.value(), policies::policy<>());
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace boost
|
||||
long ltrunc(const T& v);
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class T, class Policy>
|
||||
long long lltrunc(const T& v, const Policy& pol);
|
||||
boost::long_long_type lltrunc(const T& v, const Policy& pol);
|
||||
template <class T>
|
||||
long long lltrunc(const T& v);
|
||||
boost::long_long_type lltrunc(const T& v);
|
||||
#endif
|
||||
template <class T, class Policy>
|
||||
T round(const T& v, const Policy& pol);
|
||||
@@ -51,9 +51,9 @@ namespace boost
|
||||
long lround(const T& v);
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class T, class Policy>
|
||||
long long llround(const T& v, const Policy& pol);
|
||||
boost::long_long_type llround(const T& v, const Policy& pol);
|
||||
template <class T>
|
||||
long long llround(const T& v);
|
||||
boost::long_long_type llround(const T& v);
|
||||
#endif
|
||||
template <class T, class Policy>
|
||||
T modf(const T& v, T* ipart, const Policy& pol);
|
||||
@@ -69,9 +69,9 @@ namespace boost
|
||||
T modf(const T& v, long* ipart);
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class T, class Policy>
|
||||
T modf(const T& v, long long* ipart, const Policy& pol);
|
||||
T modf(const T& v, boost::long_long_type* ipart, const Policy& pol);
|
||||
template <class T>
|
||||
T modf(const T& v, long long* ipart);
|
||||
T modf(const T& v, boost::long_long_type* ipart);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -664,13 +664,13 @@ namespace boost
|
||||
#define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
|
||||
\
|
||||
template <class T>\
|
||||
inline T modf(const T& v, long long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
|
||||
inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\
|
||||
\
|
||||
template <class T>\
|
||||
inline long long lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
|
||||
inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\
|
||||
\
|
||||
template <class T>\
|
||||
inline long long llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
|
||||
inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\
|
||||
|
||||
#else
|
||||
#define BOOST_MATH_DETAIL_LL_FUNC(Policy)
|
||||
|
||||
@@ -53,13 +53,13 @@ inline T modf(const T& v, long* ipart)
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <class T, class Policy>
|
||||
inline T modf(const T& v, long long* ipart, const Policy& pol)
|
||||
inline T modf(const T& v, boost::long_long_type* ipart, const Policy& pol)
|
||||
{
|
||||
*ipart = lltrunc(v, pol);
|
||||
return v - *ipart;
|
||||
}
|
||||
template <class T>
|
||||
inline T modf(const T& v, long long* ipart)
|
||||
inline T modf(const T& v, boost::long_long_type* ipart)
|
||||
{
|
||||
return modf(v, ipart, policies::policy<>());
|
||||
}
|
||||
|
||||
@@ -71,16 +71,16 @@ inline long lround(const T& v)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class T, class Policy>
|
||||
inline long long llround(const T& v, const Policy& pol)
|
||||
inline boost::long_long_type llround(const T& v, const Policy& pol)
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
T r = boost::math::round(v, pol);
|
||||
if(fabs(r) > (std::numeric_limits<long long>::max)())
|
||||
return static_cast<long long>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, pol));
|
||||
return static_cast<long long>(r);
|
||||
if(fabs(r) > (std::numeric_limits<boost::long_long_type>::max)())
|
||||
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, pol));
|
||||
return static_cast<boost::long_long_type>(r);
|
||||
}
|
||||
template <class T>
|
||||
inline long long llround(const T& v)
|
||||
inline boost::long_long_type llround(const T& v)
|
||||
{
|
||||
return llround(v, policies::policy<>());
|
||||
}
|
||||
|
||||
@@ -71,16 +71,16 @@ inline long ltrunc(const T& v)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
|
||||
template <class T, class Policy>
|
||||
inline long long lltrunc(const T& v, const Policy& pol)
|
||||
inline boost::long_long_type lltrunc(const T& v, const Policy& pol)
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
T r = boost::math::trunc(v, pol);
|
||||
if(fabs(r) > (std::numeric_limits<long long>::max)())
|
||||
return static_cast<long long>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, pol));
|
||||
return static_cast<long long>(r);
|
||||
if(fabs(r) > (std::numeric_limits<boost::long_long_type>::max)())
|
||||
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, pol));
|
||||
return static_cast<boost::long_long_type>(r);
|
||||
}
|
||||
template <class T>
|
||||
inline long long lltrunc(const T& v)
|
||||
inline boost::long_long_type lltrunc(const T& v)
|
||||
{
|
||||
return lltrunc(v, policies::policy<>());
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ MyUnsigned2 dummy4;
|
||||
// Various types to test with each GCD/LCM
|
||||
typedef ::boost::mpl::list<signed char, short, int, long,
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
long long,
|
||||
boost::long_long_type,
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
__int64,
|
||||
#endif
|
||||
@@ -121,7 +121,7 @@ typedef ::boost::mpl::list<signed char, short, int, long,
|
||||
typedef ::boost::mpl::list<unsigned char, unsigned short, unsigned,
|
||||
unsigned long,
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
unsigned long long,
|
||||
boost::ulong_long_type,
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
unsigned __int64,
|
||||
#endif
|
||||
|
||||
@@ -245,7 +245,7 @@ void instantiate(RealType)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
boost::math::lltrunc(v1);
|
||||
boost::math::llround(v1);
|
||||
long long ll;
|
||||
boost::long_long_type ll;
|
||||
boost::math::modf(v1, &ll);
|
||||
#endif
|
||||
boost::math::pow<2>(v1);
|
||||
|
||||
@@ -20,7 +20,7 @@ long double lldd;
|
||||
int ii;
|
||||
long ll;
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
long long llll;
|
||||
boost::long_long_type llll;
|
||||
#endif
|
||||
|
||||
void check()
|
||||
|
||||
@@ -31,10 +31,10 @@ void check()
|
||||
check_result<long>(boost::math::lround<long double>(l));
|
||||
#endif
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
check_result<long long>(boost::math::llround<float>(f));
|
||||
check_result<long long>(boost::math::llround<double>(d));
|
||||
check_result<boost::long_long_type>(boost::math::llround<float>(f));
|
||||
check_result<boost::long_long_type>(boost::math::llround<double>(d));
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
check_result<long long>(boost::math::llround<long double>(l));
|
||||
check_result<boost::long_long_type>(boost::math::llround<long double>(l));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ void check()
|
||||
check_result<long>(boost::math::ltrunc<long double>(l));
|
||||
#endif
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
check_result<long long>(boost::math::lltrunc<float>(f));
|
||||
check_result<long long>(boost::math::lltrunc<double>(d));
|
||||
check_result<boost::long_long_type>(boost::math::lltrunc<float>(f));
|
||||
check_result<boost::long_long_type>(boost::math::lltrunc<double>(d));
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
check_result<long long>(boost::math::lltrunc<long double>(l));
|
||||
check_result<boost::long_long_type>(boost::math::lltrunc<long double>(l));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ inline void check_result_imp(long double, long double){}
|
||||
inline void check_result_imp(int, int){}
|
||||
inline void check_result_imp(long, long){}
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
inline void check_result_imp(long long, long long){}
|
||||
inline void check_result_imp(boost::long_long_type, boost::long_long_type){}
|
||||
#endif
|
||||
inline void check_result_imp(bool, bool){}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void test_return_types()
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(pow<2>(7.0l)), long double>::value));
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace boost { namespace math { namespace policies {
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
#include "test_rational.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template void do_test_spots<double, unsigned long long>(double, unsigned long long);
|
||||
template void do_test_spots<double, boost::ulong_long_type>(double, boost::ulong_long_type);
|
||||
#endif
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
#include "test_rational.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template void do_test_spots<float, unsigned long long>(float, unsigned long long);
|
||||
template void do_test_spots<float, boost::ulong_long_type>(float, boost::ulong_long_type);
|
||||
#endif
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
#include "test_rational.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template void do_test_spots<long double, unsigned long long>(long double, unsigned long long);
|
||||
template void do_test_spots<long double, boost::ulong_long_type>(long double, boost::ulong_long_type);
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
#include <boost/math/concepts/real_concept.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template void do_test_spots<boost::math::concepts::real_concept, unsigned long long>(boost::math::concepts::real_concept, unsigned long long);
|
||||
template void do_test_spots<boost::math::concepts::real_concept, boost::ulong_long_type>(boost::math::concepts::real_concept, boost::ulong_long_type);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@ void test_spots(T t, const char* n)
|
||||
do_test_spots(t, int(0));
|
||||
do_test_spots(t, unsigned(0));
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
do_test_spots(t, (unsigned long long)(0));
|
||||
do_test_spots(t, (boost::ulong_long_type)(0));
|
||||
#endif
|
||||
do_test_spots(t, float(0));
|
||||
do_test_spots(t, T(0));
|
||||
|
||||
@@ -141,9 +141,9 @@ void test_round(T, const char* name)
|
||||
}
|
||||
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
if(abs(r) < (std::numeric_limits<long long>::max)())
|
||||
if(abs(r) < (std::numeric_limits<boost::long_long_type>::max)())
|
||||
{
|
||||
long long ll = boost::math::llround(arg);
|
||||
boost::long_long_type ll = boost::math::llround(arg);
|
||||
check_within_half(arg, ll);
|
||||
ll = boost::math::lltrunc(arg);
|
||||
check_trunc_result(arg, ll);
|
||||
|
||||
Reference in New Issue
Block a user