package math32
import "gonum.org/v1/gonum/internal/math32"
Package math32 provides float32 versions of standard library math package routines used by gonum/blas/native.
Index ¶
- func Abs(x float32) float32
- func Copysign(x, y float32) float32
- func Hypot(p, q float32) float32
- func Inf(sign int) float32
- func IsInf(f float32, sign int) bool
- func IsNaN(f float32) (is bool)
- func Max(x, y float32) float32
- func Min(x, y float32) float32
- func NaN() float32
- func Signbit(x float32) bool
- func Sqrt(x float32) float32
Functions ¶
func Abs ¶
Abs returns the absolute value of x.
Special cases are:
Abs(±Inf) = +Inf Abs(NaN) = NaN
func Copysign ¶
Copysign returns a value with the magnitude of x and the sign of y.
func Hypot ¶
Hypot returns Sqrt(p*p + q*q), taking care to avoid unnecessary overflow and underflow.
Special cases are:
Hypot(±Inf, q) = +Inf Hypot(p, ±Inf) = +Inf Hypot(NaN, q) = NaN Hypot(p, NaN) = NaN
func Inf ¶
Inf returns positive infinity if sign >= 0, negative infinity if sign < 0.
func IsInf ¶
IsInf reports whether f is an infinity, according to sign. If sign > 0, IsInf reports whether f is positive infinity. If sign < 0, IsInf reports whether f is negative infinity. If sign == 0, IsInf reports whether f is either infinity.
func IsNaN ¶
IsNaN reports whether f is an IEEE 754 “not-a-number” value.
func Max ¶
Max returns the larger of x or y.
Special cases are:
Max(x, +Inf) = Max(+Inf, x) = +Inf Max(x, NaN) = Max(NaN, x) = NaN Max(+0, ±0) = Max(±0, +0) = +0 Max(-0, -0) = -0
func Min ¶
Min returns the smaller of x or y.
Special cases are:
Min(x, -Inf) = Min(-Inf, x) = -Inf Min(x, NaN) = Min(NaN, x) = NaN Min(-0, ±0) = Min(±0, -0) = -0
func NaN ¶
func NaN() float32
NaN returns an IEEE 754 “not-a-number” value.
func Signbit ¶
Signbit returns true if x is negative or negative zero.
func Sqrt ¶
Sqrt returns the square root of x.
Special cases are:
Sqrt(+Inf) = +Inf Sqrt(±0) = ±0 Sqrt(x < 0) = NaN Sqrt(NaN) = NaN
Source Files ¶
doc.go math.go signbit.go sqrt_amd64.go
- Version
- v0.15.1 (latest)
- Published
- Aug 16, 2024
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 day ago –
Tools for package owners.