48 return gnulib::trunc (x);
54 return gnulib::copysign (x, y);
65 return gnulib::round (x);
73 if (fabs (x - t) == 0.5)
95 #if defined (HAVE_LOG2)
99 static double ln2 = M_LN2;
101 static double ln2 = log (2);
104 return log (x) / ln2;
112 static double ln2 = M_LN2;
114 static double ln2 = log (2);
117 return std::log (x) / ln2;
123 #if defined (HAVE_EXP2)
127 static double ln2 = M_LN2;
129 static double ln2 = log (2);
132 return exp (x * ln2);
139 return gnulib::frexp (x, &exp);
146 double lax =
xlog2 (ax, exp);
147 return (ax != lax) ? (x / ax) * lax : x;
152 #if ! defined(HAVE_CMATH_ISNAN)
160 #if ! defined(HAVE_CMATH_ISFINITE)
168 #if ! defined(HAVE_CMATH_ISINF)
197 return -i * (log (x + i * (sqrt (1.0 - x*x))));
203 return log (x + sqrt (x*x - 1.0));
211 return -i * log (i*x + sqrt (1.0 - x*x));
217 return log (x + sqrt (x*x + 1.0));
225 return i * log ((i + x) / (i - x)) / 2.0;
231 return log ((1.0 + x) / (1.0 - x)) / 2.0;
273 return gnulib::truncf (x);
279 return gnulib::copysignf (x, y);
284 return gnulib::floorf (x);
290 return gnulib::roundf (x);
298 if (fabsf (x - t) == 0.5)
320 #if defined (HAVE_LOG2F)
322 #elif defined (HAVE_LOG2)
326 static float ln2 = M_LN2;
328 static float ln2 = log2 (2);
331 return log (x) / ln2;
339 static float ln2 = M_LN2;
341 static float ln2 = log (2);
344 return std::log (x) / ln2;
350 #if defined (HAVE_EXP2F)
352 #elif defined (HAVE_EXP2)
356 static float ln2 = M_LN2;
358 static float ln2 = log2 (2);
361 return exp (x * ln2);
368 return gnulib::frexpf (x, &exp);
375 float lax =
xlog2 (ax, exp);
376 return (ax != lax) ? (x / ax) * lax : x;
381 #if ! defined(HAVE_CMATH_ISNANF)
389 #if ! defined(HAVE_CMATH_ISFINITEF)
397 #if ! defined(HAVE_CMATH_ISINFF)
426 return -i * (log (x + i * (sqrt (static_cast<float>(1.0) - x*x))));
432 return log (x + sqrt (x*x - static_cast<float>(1.0)));
440 return -i * log (i*x + sqrt (static_cast<float>(1.0) - x*x));
446 return log (x + sqrt (x*x + static_cast<float>(1.0)));
454 return i * log ((i + x) / (i - x)) /
static_cast<float>(2.0);
460 return log ((static_cast<float>(1.0) + x) / (static_cast<float>
461 (1.0) - x)) /
static_cast<float>(2.0);
546 const double pi = 3.14159265358979323846;
553 const float pi = 3.14159265358979323846f;
560 const double pil2 = 4.53236014182719380962;
567 const float pil2 = 4.53236014182719380962f;
574 const double pil10 = 1.36437635384184134748;
575 return x < 0.0 ?
Complex (log10 (-x), pil10) :
Complex (log10 (x));
581 const float pil10 = 1.36437635384184134748f;
645 return static_cast<int> ((x > 0) ? (x + 0.5) : (x - 0.5));
656 return static_cast<int> ((x > 0) ? (x + 0.5) : (x - 0.5));