◆ abs
using metal::abs = typedef metal::max<num, metal::neg<num> > |
#include <metal/number/abs.hpp>
Description
Computes absolute value of a Number.
Usage
For any Number num
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<(num{} > 0) ? num{} : -num{}>;
Example
See Also
◆ add
using metal::add = typedef fold_left<lambda<detail::add>, nums..., number<0> > |
#include <metal/number/add.hpp>
Description
Computes the arithmetic addition of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} + ... + num_n-1{}>;
Example
See Also
◆ and_
using metal::and_ = typedef metal::same<metal::false_, metal::not_<nums>...> |
#include <metal/number/and.hpp>
Description
Computes the logical conjunction of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} && ... && num_n-1{}>;
Example
See Also
◆ as_number
using metal::as_number = typedef typename detail::_as_number<val>::type |
#include <metal/number/number.hpp>
Description
Constructs a Number out of any Value that defines a nested integral constant value
convertible to metal::int_.
Usage
For any Value val
- Returns
- : Number
Example
See Also
- See also
- number
◆ dec
using metal::dec = typedef metal::sub<num, metal::number<1> > |
#include <metal/number/dec.hpp>
Description
Decrements a Number.
Usage
For any Number num
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num{} - 1>;
Example
See Also
◆ div
using metal::div = typedef fold_left<lambda<detail::div>, nums..., number<1> > |
#include <metal/number/div.hpp>
Description
Computes the quotient of the arithmetic division of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Precondition
- : All Numbers in
num_1, ..., num_n-1
are nonzero
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} / ... / num_n-1{}>;
Example
See Also
◆ false_
using metal::false_ = typedef metal::number<false> |
◆ greater
using metal::greater = typedef metal::less<y, x> |
#include <metal/number/greater.hpp>
Description
Checks whether a Number is greater than another.
Usage
For any Numbers x
and y
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<(x{} > y{})>;
Example
See Also
◆ if_
using metal::if_ = typedef detail::call<detail::_if_<cond>::template type, then...> |
#include <metal/number/if.hpp>
Description
A conditional expression.
Usage
For any Number num
and Values x, y
- Returns
- : Value
- Semantics:
- If
num{} != false
, thenotherwiseusing result = x;using result = y;
num{} != false
, y
may be omitted.Example
See Also
- See also
- number
◆ inc
using metal::inc = typedef metal::add<num, metal::number<1> > |
#include <metal/number/inc.hpp>
Description
Increments a Number.
Usage
For any Number num
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num::{} + 1>;
Example
See Also
◆ int_
using metal::int_ = typedef detail::int_ |
◆ is_number
using metal::is_number = typedef typename detail::_is_number<val>::type |
#include <metal/number/number.hpp>
Description
Checks whether some Value is a Number.
Usage
For any Value val
- Returns
- : Number
- Semantics:
- If
val
is a Number, thenotherwiseusing result = metal::true_;using result = metal::false_;
Example
See Also
◆ less
using metal::less = typedef typename detail::_less<x, y>::type |
#include <metal/number/less.hpp>
Description
Checks whether a Number is less than another.
Usage
For any Numbers x
and y
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<(x{} < y{})>;
Example
See Also
◆ max
using metal::max = typedef fold_left<lambda<detail::max>, if_<is_number<nums>, nums>...> |
#include <metal/number/max.hpp>
Description
Computes the maximum of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- If
M
the maximum between all Numbers innum_0, ..., num_n-1
, thenusing result = M;
Example
See Also
◆ min
using metal::min = typedef fold_left<lambda<detail::min>, if_<is_number<nums>, nums>...> |
#include <metal/number/min.hpp>
Description
Computes the minimum of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- If
m
the minimum between all Numbers innum_0, ..., num_n-1
, thenusing result = m;
Example
See Also
◆ mod
using metal::mod = typedef fold_left<lambda<detail::mod>, if_<is_number<nums>, nums>...> |
#include <metal/number/mod.hpp>
Description
Computes the remainder of the arithmetic division of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Precondition
- : All Numbers in
num_1, ..., num_n-1
are nonzero
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} % ... % num_n-1{}>;
Example
See Also
◆ mul
using metal::mul = typedef fold_left<lambda<detail::mul>, nums..., number<1> > |
#include <metal/number/mul.hpp>
Description
Computes the arithmetic multiplication of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} * ... * num_n-1{}>;
Example
See Also
◆ neg
using metal::neg = typedef metal::sub<metal::number<0>, num> |
#include <metal/number/neg.hpp>
Description
Computes the additive inverse of a Number.
Usage
For any Number num
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<-num{}>;
Example
See Also
◆ not_
using metal::not_ = typedef metal::if_<num, metal::false_, metal::true_> |
#include <metal/number/not.hpp>
Description
Computes the logical inverse of a Number.
Usage
For any Number num
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<!num{}>;
Example
See Also
◆ number
using metal::number = typedef std::integral_constant<metal::int_, v> |
◆ numbers
using metal::numbers = typedef metal::list<metal::number<vs>...> |
#include <metal/number/numbers.hpp>
Description
Constructs a List of Numbers out of a sequence of integral values.
Example
See Also
◆ or_
using metal::or_ = typedef metal::not_<metal::same<metal::true_, metal::not_<nums>...> > |
#include <metal/number/or.hpp>
Description
Computes the logical disjunction of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} || ... || num_n-1{}>;
Example
See Also
◆ pow
using metal::pow = typedef fold_left<lambda<detail::pow>, nums..., number<1> > |
#include <metal/number/pow.hpp>
Description
Computes the arithmetic exponentiation of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Precondition
- :
metal::pow<num_0, ..., num_m-1> != metal::number<0>
for all negativenum_m
- Returns
- : Number
- Semantics:
- Equivalent to Whereusing result = metal::number<num_0{} ** ... ** num_n-1{}>;
x**y
stands forx
raised to the power ofy
Warningx**y
is always null fory < 0
and|x| > 1
due to inherent limitations of integer arithmetic.
Example
See Also
◆ sub
using metal::sub = typedef fold_left<lambda<detail::sub>, nums..., number<0> > |
#include <metal/number/sub.hpp>
Description
Computes the arithmetic subtraction of Numbers.
Usage
For any Numbers num_0, ..., num_n-1
- Returns
- : Number
- Semantics:
- Equivalent to using result = metal::number<num_0{} - ... - num_n-1{}>;
Example
See Also
◆ true_
using metal::true_ = typedef metal::number<true> |