y=cube(x) returns the cube of the argument for any numeric type, integral or floating point.
More...
y=cube(x) returns the cube of the argument for any numeric type, integral or floating point.
We promise to evaluate x only once. We assume is is acceptable for the result type to be the same as the argument type; if it won't fit caller must cast argument to a wider type first. This is an inline routine which will run as fast as explicit multiplies (x*x*x) in optimized code, and significantly faster for complex or conjugate types (8 flops vs. 11).
Cubing a negated real type returns a negated result. Cubing a negated complex or conjugate returns a non-negated complex result since that can be done with no additional cost.
◆ cube() [1/19]
unsigned char SimTK::cube |
( |
unsigned char |
u | ) |
|
|
inline |
◆ cube() [2/19]
unsigned short SimTK::cube |
( |
unsigned short |
u | ) |
|
|
inline |
◆ cube() [3/19]
unsigned int SimTK::cube |
( |
unsigned int |
u | ) |
|
|
inline |
◆ cube() [4/19]
unsigned long SimTK::cube |
( |
unsigned long |
u | ) |
|
|
inline |
◆ cube() [5/19]
unsigned long long SimTK::cube |
( |
unsigned long long |
u | ) |
|
|
inline |
◆ cube() [6/19]
char SimTK::cube |
( |
char |
c | ) |
|
|
inline |
◆ cube() [7/19]
signed char SimTK::cube |
( |
signed char |
i | ) |
|
|
inline |
◆ cube() [8/19]
short SimTK::cube |
( |
short |
i | ) |
|
|
inline |
◆ cube() [9/19]
◆ cube() [10/19]
long SimTK::cube |
( |
long |
i | ) |
|
|
inline |
◆ cube() [11/19]
long long SimTK::cube |
( |
long long |
i | ) |
|
|
inline |
◆ cube() [12/19]
float SimTK::cube |
( |
const float & |
x | ) |
|
|
inline |
◆ cube() [13/19]
double SimTK::cube |
( |
const double & |
x | ) |
|
|
inline |
◆ cube() [14/19]
◆ cube() [15/19]
◆ cube() [16/19]
template<class P >
std::complex<P> SimTK::cube |
( |
const std::complex< P > & |
x | ) |
|
|
inline |
◆ cube() [17/19]
template<class P >
std::complex<P> SimTK::cube |
( |
const negator< std::complex< P > > & |
x | ) |
|
|
inline |
◆ cube() [18/19]
template<class P >
std::complex<P> SimTK::cube |
( |
const conjugate< P > & |
x | ) |
|
|
inline |
◆ cube() [19/19]