示例#1
0
const T& get_constant_e()
{
   static T result;
   static bool b = false;
   if(!b)
   {
      calc_e(result, geofeatures_boost::multiprecision::detail::digits2<number<T, et_on> >::value);
      b = true;
   }

   constant_initializer<T, &get_constant_e<T> >::do_nothing();

   return result;
}
示例#2
0
const T& get_constant_e()
{
   static BOOST_MP_THREAD_LOCAL T result;
   static BOOST_MP_THREAD_LOCAL long digits = 0;
#ifndef BOOST_MP_USING_THREAD_LOCAL
   static BOOST_MP_THREAD_LOCAL bool b = false;
   constant_initializer<T, &get_constant_e<T> >::do_nothing();

   if (!b || (digits != boost::multiprecision::detail::digits2<number<T> >::value()))
   {
      b = true;
#else
   if ((digits != boost::multiprecision::detail::digits2<number<T> >::value()))
   {
#endif
      calc_e(result, boost::multiprecision::detail::digits2<number<T, et_on> >::value());
      digits = boost::multiprecision::detail::digits2<number<T> >::value();
   }

   return result;
}