DoxigAlpha

cbrt

Returns the cube root of x.

Special Cases:

  • cbrt(+-0) = +-0
  • cbrt(+-inf) = +-inf
  • cbrt(nan) = nan

Function parameters

Parameters

#
x:anytype

Returns the cube root of x.

Functions

#
cbrt
Returns the cube root of x.

Source

Implementation

#
pub fn cbrt(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    return switch (T) {
        f32 => cbrt32(x),
        f64 => cbrt64(x),
        else => @compileError("cbrt not implemented for " ++ @typeName(T)),
    };
}