Documentation
¶
Index ¶
- Variables
- func Abs[T constraints.Float](x T) T
- func FastInvSqrt[T constraints.Float](input T, iterations int) (output T, err error)
- func FastInvSqrt32(input float32, iterations int) (output float32, err error)
- func FastInvSqrt64(input float64, iterations int) (output float64, err error)
- func IsNaN[T constraints.Float](f T) (is bool)
- func NaN[T constraints.Float]() (out T)
Constants ¶
This section is empty.
Variables ¶
var ( ErrIndRes = errors.New("indetermined result") ErrIterMin = errors.New("minimum iteration not met") )
Functions ¶
func Abs ¶
func Abs[T constraints.Float](x T) T
Abs returns the absolute value of x.
Special cases are:
Abs(±Inf) = +Inf Abs(NaN) = NaN
func FastInvSqrt ¶
func FastInvSqrt[T constraints.Float](input T, iterations int) (output T, err error)
FastInvSqrt implements Quake III's Fast Inverse Square Root algorythm for Float types (64 and 32) Input: - input: float radicand - iterations: integer with the required estimation iterations (Newton-Raphson approximation) Output: - output: inverse square root - error
func FastInvSqrt32 ¶
FastInvSqrt32 implements Quake III's Fast Inverse Square Root algorythm for float32 types Input: - input: float 32 radicand - iterations: integer with the required estimation iterations (Newton-Raphson approximation) Output: - output: inverse square root - error
func FastInvSqrt64 ¶
FastInvSqrt64 implements Quake III's Fast Inverse Square Root algorythm for float32 types Input: - input: float 64 radicand - iterations: integer with the required estimation iterations (Newton-Raphson approximation) Output: - output: inverse square root - error
func IsNaN ¶
func IsNaN[T constraints.Float](f T) (is bool)
IsNaN reports whether f is an IEEE 754 “not-a-number” value.
Types ¶
This section is empty.