17#ifndef GZ_MATH_FUNCTIONS_HH_
18#define GZ_MATH_FUNCTIONS_HH_
31#include <gz/math/config.hh>
32#include "gz/math/Export.hh"
45#define GZ_SQRT2 M_SQRT2
47#define GZ_PI 3.14159265358979323846
48#define GZ_PI_2 1.57079632679489661923
49#define GZ_PI_4 0.78539816339744830962
50#define GZ_SQRT2 1.41421356237309504880
56#if defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 2
57#define GZ_FP_VOLATILE volatile
64#define GZ_SPHERE_VOLUME(_radius) (4.0*GZ_PI*std::pow(_radius, 3)/3.0)
69#define GZ_CONE_VOLUME(_r, _l) (_l * GZ_PI * std::pow(_r, 2) / 3.0)
74#define GZ_CYLINDER_VOLUME(_r, _l) (_l * GZ_PI * std::pow(_r, 2))
80#define GZ_BOX_VOLUME(_x, _y, _z) (_x *_y * _z)
84#define GZ_BOX_VOLUME_V(_v) (_v.X() *_v.Y() * _v.Z())
89 inline namespace GZ_MATH_VERSION_NAMESPACE {
298 return (
_v % 2) != 0;
306 return (
_v % 2) != 0;
340 for (
unsigned int i = 0;
i <
_values.size(); ++
i)
342 return sum /
static_cast<T
>(
_values.size());
354 for (
unsigned int i = 0;
i <
_values.size(); ++
i)
356 return sum /
static_cast<T
>(
_values.size());
485 return ((
_x != 0) && ((
_x & (~
_x + 1)) ==
_x));
501 while (
_x & (
_x - 1))
529 return -(std::abs(
_num) - remainder);
551 const std::chrono::steady_clock::time_point &
_time);
578 const std::chrono::steady_clock::duration &
_dur);
594 using discard =
int[];
596 (std::get<Durations>(
retval) =
597 std::chrono::duration_cast<Durations>(d)),
598 (d -= std::chrono::duration_cast<DurationIn>(
599 std::get<Durations>(
retval))))), 0)...};
607 const std::chrono::steady_clock::time_point &
_point);
613 const std::chrono::steady_clock::duration &
_duration);
636 uint64_t d,
h, m, s,
ms;
655 std::chrono::steady_clock::time_point
662#if defined _MSC_VER || defined __arm__