Simbody
3.8
|
y=cube(x) returns the cube of the argument for any numeric type, integral or floating point.
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.