MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
math.hpp
浏览该文件的文档.
1#ifndef MSTL_CORE_NUMERIC_MATH_HPP__
2#define MSTL_CORE_NUMERIC_MATH_HPP__
3
11
14
18
24
25MSTL_INLINE17 constexpr decimal_t EULER = 2.718281828459045L;
26MSTL_INLINE17 constexpr decimal_t PI = 3.141592653589793L;
27MSTL_INLINE17 constexpr decimal_t PHI = 1.618033988749895L;
28MSTL_INLINE17 constexpr decimal_t SEMI_CIRCLE = 180.0;
29MSTL_INLINE17 constexpr decimal_t CIRCLE = 360.0;
30MSTL_INLINE17 constexpr decimal_t EPSILON = 1e-15L;
31
32MSTL_INLINE17 constexpr uint32_t TAYLOR_CONVERGENCE = 10000U;
35
41MSTL_INLINE17 constexpr uint64_t FIBONACCI_LIST[] = {
42 0, 1, 1, 2, 3,
43 5, 8, 13, 21, 34,
44 55, 89, 144, 233, 377,
45 610, 987, 1597, 2584, 4181,
46 6765, 10946, 17711, 28657, 46368,
47 75025, 121393, 196418, 317811, 514229,
48 832040, 1346269, 2178309, 3524578, 5702887,
49 9227465, 14930352, 24157817, 39088169, 63245986,
50 102334155, 165580141, 267914296, 433494437, 701408733,
51 1134903170, 1836311903, 2971215073, 4807526976, 7778742049
52};
53
54MSTL_INLINE17 constexpr uint32_t FIBONACCI_COUNT = extent_v<decltype(FIBONACCI_LIST)>;
55 // MathConstants
57
61
67
76MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 uint64_t fibonacci(const uint32_t n) {
78 return _CONSTANTS FIBONACCI_LIST[n];
79 }
80 return fibonacci(n - 1) + fibonacci(n - 2);
81}
82
90MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 uint64_t leonardo(const uint32_t n) {
91 return 2 * fibonacci(n + 1) - 1;
92}
93
100template <typename T>
101MSTL_PURE_FUNCTION constexpr T angular2radian(const T angular) noexcept {
102 static_assert(is_arithmetic_v<T>, "arithmetic required");
103 return angular * _CONSTANTS PI / _CONSTANTS SEMI_CIRCLE;
104}
105
112template <typename T>
113MSTL_PURE_FUNCTION constexpr T radian2angular(const T radian) noexcept {
114 static_assert(is_arithmetic_v<T>, "arithmetic required");
115 return radian * (_CONSTANTS SEMI_CIRCLE / _CONSTANTS PI);
116}
117
124template <typename T>
125MSTL_CONST_FUNCTION constexpr enable_if_t<is_signed_v<T>, T>
126absolute(const T x) noexcept {
127 return x > T(0) ? x : -x;
128}
129
136
137template <typename T>
138MSTL_CONST_FUNCTION constexpr enable_if_t<is_unsigned_v<T>, T>
139absolute(const T x) noexcept {
140 return x;
141}
142
151template <typename T>
152MSTL_CONST_FUNCTION constexpr const T& sum(const T& x) noexcept {
153 return x;
154}
155
164template <typename First, typename... Rests, enable_if_t<(sizeof...(Rests) > 0), int> = 0>
165MSTL_CONST_FUNCTION constexpr decltype(auto) sum(First first, Rests... args) {
166 return first + _MSTL sum(args...);
167}
168
175template <typename... Args, enable_if_t<(sizeof...(Args) > 0), int> = 0>
176MSTL_CONST_FUNCTION constexpr decltype(auto) average(Args... args) {
177 return _MSTL sum(args...) / sizeof...(Args);
178}
179
186template <typename T>
187MSTL_CONSTEXPR14 int sign(const T& value) noexcept {
188 static_assert(is_arithmetic_v<T>, "arithmetic required");
189 constexpr T zero = T(0);
190 if (value > zero) return 1;
191 if (value < zero) return -1;
192 return 0;
193}
194
202template <typename T>
203MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T gcd(const T& m, const T& n) noexcept {
204 T x = _MSTL absolute(m), y = _MSTL absolute(n);
205 constexpr T zero = T(0);
206 while (y != zero) {
207 T t = x % y;
208 x = y;
209 y = t;
210 }
211 return x;
212}
213
221template <typename T>
222MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T lcm(const T& m, const T& n) noexcept {
223 return m * n / _MSTL gcd(m, n);
224}
225
226
235template <typename T>
236MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T float_mod(const T x, const T y) {
237 static_assert(is_arithmetic_v<T>, "arithmetic required");
238 if (y == 0) throw_exception(math_exception("zero can not be dividend."));
239 const T result = x - static_cast<make_integer_t<sizeof(T)>>(x / y) * y;
240 return result;
241}
242
252template <typename T>
253MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T power(const T& x, uint32_t n) noexcept {
254 static_assert(is_arithmetic_v<T>, "arithmetic required");
255 if (n == 0) return 1;
256 T result(1);
257 T base = x;
258 while (n > 0) {
259 if (n % 2 == 1) {
260 result *= base;
261 }
262 base *= base;
263 n /= 2;
264 }
265 return result;
266}
267
273MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t exponential(const uint32_t n) noexcept {
274 return power(_CONSTANTS EULER, n);
275}
276
285template <typename T>
286MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_e(const T x) noexcept {
287 static_assert(is_floating_point_v<T>, "floating point required");
289 const T a = (x - 1) / (x + 1);
290 const T a_sqrt = a * a;
291 T nk = 2 * N + 1;
292 T y = 1.0 / nk;
293 while (N--) {
294 nk -= 2;
295 y = 1.0 / nk + a_sqrt * y;
296 }
297 return 2.0 * a * y;
298}
299
307template <typename T>
308MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm(const T x, const uint32_t base) {
309 const auto under = _MSTL logarithm_e(static_cast<float64_t>(base));
310 if (under == 0) {
311 throw_exception(math_exception("zero can not be dividend."));
312 }
313 return _MSTL logarithm_e(x) / under;
314}
315
322template <typename T>
323MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_2(const T x) {
324 return _MSTL logarithm(x, 2);
325}
326
333template <typename T>
334MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_10(const T x) {
335 return _MSTL logarithm(x, 10);
336}
337
346MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t
347square_root(const decimal_t x, const decimal_t precise = _CONSTANTS PRECISE_TOLERANCE) noexcept {
348 decimal_t t = 0.0;
349 decimal_t result = x;
350 while (absolute(result - t) > precise) {
351 t = result;
352 result = 0.5 * (t + x / t);
353 }
354 return result;
355}
356
365MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t
366cube_root(const decimal_t x, const decimal_t precise = _CONSTANTS PRECISE_TOLERANCE) noexcept {
367 decimal_t t = 0.0;
368 decimal_t result = x;
369 while (absolute(result - t) > precise) {
370 t = result;
371 result = (2 * t + x / (t * t)) / 3;
372 }
373 return result;
374}
375
381MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 uint64_t factorial(const uint32_t n) noexcept {
382 uint64_t h = 1;
383 for (uint32_t i = 1; i <= n; i++) {
384 h *= i;
385 }
386 return h;
387}
388
389
396MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t floor_bit(const decimal_t x, const uint32_t bit) noexcept {
397 const decimal_t times = power(10.0, bit);
398 const auto int_part = x * times;
399 if (x < 0 && x * times * 10 / 10.0 != int_part)
400 return (int_part - 1) / times;
401 return int_part / times;
402}
403
410MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t ceil_bit(const decimal_t x, const uint32_t bit) noexcept {
411 const decimal_t times = power(10.0, bit);
412 const auto int_part = x * times;
413 if (x > 0 && x * times * 10 / 10.0 != int_part)
414 return (int_part + 1) / times;
415 return int_part / times;
416}
417
424MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t round_bit(const decimal_t x, const uint32_t bit) noexcept {
425 return x < 0 ?
426 ceil_bit(x - 0.5 / power(10.0, bit), bit) :
427 floor_bit(x + 0.5 / power(10.0, bit), bit);
428}
429
436MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t truncate_bit(const decimal_t x, const uint32_t bit) noexcept {
437 return x < 0 ? ceil_bit(x, bit) : floor_bit(x, bit);
438}
439
440
446MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t floor(const decimal_t x) noexcept {
447 return (x >= 0) ? static_cast<int64_t>(x) : static_cast<int64_t>(x - 1);
448}
449
456MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t floor(const decimal_t x, const uint32_t bit) noexcept {
457 const decimal_t factor = power(10.0, bit);
458 return floor(x * factor) / factor;
459}
460
466MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t ceil(const decimal_t x) noexcept {
467 return (x >= 0) ? static_cast<int64_t>(x + 1) : static_cast<int64_t>(x);
468}
469
476MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t ceil(const decimal_t x, const uint32_t bit) noexcept {
477 const decimal_t factor = power(10.0, bit);
478 return ceil(x * factor) / factor;
479}
480
486MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t round(const decimal_t x) noexcept {
487 return (x >= 0) ? floor(x + 0.5) : ceil(x - 0.5);
488}
489
496MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t round(const decimal_t x, const uint32_t bit) noexcept {
497 const decimal_t factor = power(10.0, bit);
498 return round(x * factor) / factor;
499}
500
507MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t truncate(const decimal_t x, const int bit) noexcept {
508 return x < 0 ? ceil(x, bit) : floor(x, bit);
509}
510
516MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t truncate(const decimal_t x) noexcept {
517 return truncate(x, 0);
518}
519
520
529MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_multiple(const decimal_t x, const decimal_t axis,
530 const decimal_t toler = _CONSTANTS PRECISE_TOLERANCE) {
532 throw_exception(math_exception("Axis Cannot be 0"));
533 }
534 const decimal_t multi = _MSTL round(x / axis) * axis;
535 return absolute(x - multi) < toler;
536}
537
544MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_pi(const decimal_t x,
546 return around_multiple(x, _CONSTANTS PI, toler);
547}
548
555MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_zero(const decimal_t x,
556 const decimal_t toler = _CONSTANTS PRECISE_TOLERANCE) {
557 return absolute(x) < toler;
558}
559
560
569MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t remainder(const decimal_t x, const decimal_t y) noexcept {
570 return x - y * _MSTL round(x / y);
571}
572
578MSTL_CONST_FUNCTION constexpr decimal_t float_part(const decimal_t x) noexcept {
579 return x - static_cast<int64_t>(x);
580}
581
590MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t float_apart(decimal_t x, int64_t* int_ptr) noexcept {
591 *int_ptr = static_cast<int64_t>(x);
592 x -= *int_ptr;
593 return x;
594}
595
596
604MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t sine(decimal_t x) noexcept {
605 decimal_t sign = 1.0;
606 if (x < 0) {
607 sign = -1.0;
608 x = -x;
609 }
610 constexpr decimal_t twoPi = 2 * _CONSTANTS PI;
611 x = x - twoPi * floor(x / twoPi);
612
613 if (x > _CONSTANTS PI) {
614 x -= _CONSTANTS PI;
615 sign = -sign;
616 }
617 if (x > _CONSTANTS PI / 2) {
618 x = _CONSTANTS PI - x;
619 }
620
621 decimal_t i = 1;
622 int32_t neg = 1;
623 decimal_t sum = 0;
624 decimal_t idx = x;
625 decimal_t fac = 1;
626 decimal_t taylor = x;
627 do {
628 fac = fac * (i + 1) * (i + 2);
629 idx *= x * x;
630 neg = -neg;
631 sum = idx / fac * neg;
632 taylor += sum;
633 i += 2;
634 } while (absolute(sum) > _CONSTANTS EPSILON);
635 const auto fin = sign * taylor;
636 return around_zero(fin) ? 0 : fin;
637}
638
646MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t cosine(const decimal_t x) noexcept {
647 return sine(_CONSTANTS PI / 2.0 - x);
648}
649
656MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t tangent(const decimal_t x) {
657 const decimal_t multiple = (2 * _MSTL round((2 * x - _CONSTANTS PI)
658 / (2 * _CONSTANTS PI)) + 1) * (_CONSTANTS PI / 2);
659 if (absolute(x - multiple) < _CONSTANTS LOW_PRECISE_TOLERANCE) {
660 throw_exception(math_exception("Tangent Range Exceeded"));
661 }
662 return sine(x) / cosine(x);
663}
664
671MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t cotangent(const decimal_t x) {
672 return 1 / tangent(x);
673}
674
677
685MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t __arctangent_taylor(const decimal_t x) noexcept {
686 const decimal_t x_sq = x * x;
687 decimal_t term = x;
688 decimal_t sum = x;
689 decimal_t n = 1.0;
690 while (absolute(term) > _CONSTANTS EPSILON) {
691 term *= -x_sq;
692 n += 2.0;
693 sum += term / n;
694 }
695 return sum;
696}
697
700
708MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arctangent(const decimal_t x) noexcept {
709 if (absolute(x) > 1) {
710 const decimal_t sign = x > 0 ? 1.0 : -1.0;
711 return sign * (_CONSTANTS PI / 2 - _INNER __arctangent_taylor(1 / absolute(x)));
712 }
713 return _INNER __arctangent_taylor(x);
714}
715
722MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arcsine(const decimal_t x) {
723 if (_MSTL absolute(x) > 1) {
724 throw_exception(math_exception("Arcsine Range Exceeded"));
725 }
726 return arctangent(x / square_root(1 - x * x));
727}
728
735MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arccosine(const decimal_t x) {
736 if (_MSTL absolute(x) > 1) {
737 throw_exception(math_exception("Arccosine Range Exceeded"));
738 }
739 return _CONSTANTS PI / 2.0 - arcsine(x);
740}
741 // MathFunctions
743
745#endif // MSTL_CORE_NUMERIC_MATH_HPP__
MSTL异常处理框架
unsigned int uint32_t
32位无符号整数类型
long double decimal_t
扩展精度浮点数类型
long long int64_t
64位有符号整数类型
double float64_t
64位双精度浮点数类型
unsigned long long uint64_t
64位无符号整数类型
int int32_t
32位有符号整数类型
MSTL_INLINE17 constexpr decimal_t SEMI_CIRCLE
半圆角度 180°(角度制)
MSTL_INLINE17 constexpr decimal_t PI
圆周率 π(弧度制)
MSTL_INLINE17 constexpr decimal_t PHI
黄金分割比 φ
MSTL_INLINE17 constexpr uint32_t FIBONACCI_COUNT
斐波那契数列预计算数量
MSTL_INLINE17 constexpr decimal_t EULER
自然常数 e
MSTL_INLINE17 constexpr uint32_t TAYLOR_CONVERGENCE
泰勒展开收敛项数
MSTL_INLINE17 constexpr decimal_t PRECISE_TOLERANCE
精确容差
MSTL_INLINE17 constexpr decimal_t CIRCLE
全圆角度 360°(角度制)
MSTL_INLINE17 constexpr uint64_t FIBONACCI_LIST[]
预计算的斐波那契数列
MSTL_INLINE17 constexpr decimal_t EPSILON
浮点数精度容差
MSTL_INLINE17 constexpr decimal_t LOW_PRECISE_TOLERANCE
低精度容差
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_multiple(const decimal_t x, const decimal_t axis, const decimal_t toler=_CONSTANTS PRECISE_TOLERANCE)
判断是否接近某个倍数值
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t cotangent(const decimal_t x)
计算余切值
MSTL_PURE_FUNCTION constexpr T angular2radian(const T angular) noexcept
角度转弧度
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_zero(const decimal_t x, const decimal_t toler=_CONSTANTS PRECISE_TOLERANCE)
判断是否接近零
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arcsine(const decimal_t x)
计算反正弦值
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t round_bit(const decimal_t x, const uint32_t bit) noexcept
四舍五入到指定位数
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t square_root(const decimal_t x, const decimal_t precise=_CONSTANTS PRECISE_TOLERANCE) noexcept
计算平方根
MSTL_CONST_FUNCTION constexpr const T & sum(const T &x) noexcept
单参数求和
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 uint64_t leonardo(const uint32_t n)
计算莱昂纳多数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t truncate_bit(const decimal_t x, const uint32_t bit) noexcept
截断到指定位数
MSTL_CONST_FUNCTION constexpr decimal_t float_part(const decimal_t x) noexcept
获取小数部分
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 uint64_t factorial(const uint32_t n) noexcept
计算阶乘
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t float_apart(decimal_t x, int64_t *int_ptr) noexcept
分离整数和小数部分
MSTL_CONSTEXPR14 int sign(const T &value) noexcept
获取数值的符号
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t exponential(const uint32_t n) noexcept
计算e的n次幂
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T float_mod(const T x, const T y)
浮点数取模运算
MSTL_PURE_FUNCTION constexpr T radian2angular(const T radian) noexcept
弧度转角度
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_e(const T x) noexcept
计算自然对数
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t tangent(const decimal_t x)
计算正切值
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arctangent(const decimal_t x) noexcept
计算反正切值
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 uint64_t fibonacci(const uint32_t n)
计算斐波那契数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t ceil_bit(const decimal_t x, const uint32_t bit) noexcept
向上舍入到指定位数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t floor(const decimal_t x) noexcept
向下取整
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t truncate(const decimal_t x, const int bit) noexcept
截断
MSTL_CONST_FUNCTION constexpr decltype(auto) average(Args... args)
计算平均值
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm(const T x, const uint32_t base)
计算任意底数的对数
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t cube_root(const decimal_t x, const decimal_t precise=_CONSTANTS PRECISE_TOLERANCE) noexcept
计算立方根
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t sine(decimal_t x) noexcept
计算正弦值
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 bool around_pi(const decimal_t x, const decimal_t toler=_CONSTANTS LOW_PRECISE_TOLERANCE)
判断是否接近π的整数倍
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T lcm(const T &m, const T &n) noexcept
计算最小公倍数
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t cosine(const decimal_t x) noexcept
计算余弦值
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t remainder(const decimal_t x, const decimal_t y) noexcept
计算余数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t round(const decimal_t x) noexcept
四舍五入
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t ceil(const decimal_t x) noexcept
向上取整
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T gcd(const T &m, const T &n) noexcept
计算最大公约数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 decimal_t floor_bit(const decimal_t x, const uint32_t bit) noexcept
向下舍入到指定位数
MSTL_CONST_FUNCTION MSTL_CONSTEXPR14 T power(const T &x, uint32_t n) noexcept
幂运算
MSTL_CONST_FUNCTION constexpr enable_if_t< is_signed_v< T >, T > absolute(const T x) noexcept
取绝对值(有符号数版本)
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 decimal_t arccosine(const decimal_t x)
计算反余弦值
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_2(const T x)
计算以2为底的对数
MSTL_PURE_FUNCTION MSTL_CONSTEXPR14 T logarithm_10(const T x)
计算以10为底的对数
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_CONSTANTS__
结束constants命名空间
#define MSTL_END_INNER__
结束inner命名空间
#define _CONSTANTS
constants命名空间前缀
#define _INNER
inner命名空间前缀
#define MSTL_BEGIN_CONSTANTS__
开始constants命名空间
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
#define MSTL_BEGIN_INNER__
开始inner命名空间
typename make_integer< Size, IsSigned >::type make_integer_t
make_integer的便捷别名
typename enable_if< Test, T >::type enable_if_t
enable_if的便捷别名
数学计算异常