Documentation
¶
Overview ¶
Package math provides basic constants and mathematical functions.
Index ¶
- Constants
- func Abs(x float64) float64
- func Abs32(x float32) float32
- func Ceil(x float64) float64
- func Float32bits(f float32) uint32
- func Float32frombits(b uint32) float32
- func Float64bits(f float64) uint64
- func Float64frombits(b uint64) float64
- func Floor(x float64) float64
- func Frexpi(f float64) (int64, int)
- func Frexpi32(f float32) (int32, int)
- func Inf(sign int) float64
- func Inf32(sign int) float32
- func IsInf(f float64, sign int) bool
- func IsInf32(f float32, sign int) bool
- func IsNaN(f float64) (is bool)
- func IsNaN32(f float32) (is bool)
- func Modf(f float64) (int float64, frac float64)
- func MulDiv(x, m, d uint64) uint64
- func MulDivUp(x, m, d uint64) uint64
- func NaN() float64
- func NaN32() float32
- func Signbit(x float64) bool
- func Signbit32(x float32) bool
- func Trunc(x float64) float64
Constants ¶
const ( MaxFloat32 = 3.40282346638528859811704183484516925440e+38 MaxFloat64 = 1.797693134862315708145274237317043567981e+308 )
Variables ¶
This section is empty.
Functions ¶
func Ceil ¶
Ceil returns the least integer value greater than or equal to x.
Special cases are:
Ceil(±0) = ±0 Ceil(±Inf) = ±Inf Ceil(NaN) = NaN
func Float32bits ¶
Float32bits returns the IEEE 754 binary representation of f.
func Float32frombits ¶
Float32frombits returns the floating point number corresponding to the IEEE 754 binary representation b.
func Float64bits ¶
Float64bits returns the IEEE 754 binary representation of f.
func Float64frombits ¶
Float64frombits returns the floating point number corresponding the IEEE 754 binary representation b.
func Floor ¶
Floor returns the greatest integer value less than or equal to x.
Special cases are:
Floor(±0) = ±0 Floor(±Inf) = ±Inf Floor(NaN) = NaN
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 Modf ¶
Modf returns integer and fractional floating-point numbers that sum to f. Both values have the same sign as f.
Special cases are:
Modf(±Inf) = ±Inf, NaN Modf(NaN) = NaN, NaN
Types ¶
This section is empty.