Documentation ¶
Index ¶
- type Float16
- func (a Float16) Add(b Float16) Float16
- func (x Float16) Append(buf []byte, fmt byte, prec int) []byte
- func (f Float16) Bits() uint16
- func (a Float16) Compare(b Float16) int
- func (a Float16) Eq(b Float16) bool
- func (f Float16) Float32() float32
- func (f Float16) Float64() float64
- func (x Float16) Format(s fmt.State, verb rune)
- func (a Float16) Ge(b Float16) bool
- func (a Float16) Gt(b Float16) bool
- func (f Float16) IsInf(sign int) bool
- func (f Float16) IsNaN() bool
- func (a Float16) Le(b Float16) bool
- func (a Float16) Lt(b Float16) bool
- func (a Float16) Mul(b Float16) Float16
- func (a Float16) Ne(b Float16) bool
- func (a Float16) Quo(b Float16) Float16
- func (x Float16) Sqrt() Float16
- func (x Float16) String() string
- func (a Float16) Sub(b Float16) Float16
- func (x Float16) Text(fmt byte, prec int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Float16 ¶
type Float16 uint16
Float16 represents a 16-bit floating point number.
func FMA ¶ added in v0.3.0
FMA returns x * y + z, computed with only one rounding. (That is, FMA returns the fused multiply-add of x, y, and z.)
func FromBits ¶
FromBits returns the floating point number corresponding the IEEE 754 binary representation b.
func FromFloat32 ¶
FromFloat32 returns the floating point number corresponding to the IEEE 754 binary representation of f.
func FromFloat64 ¶
FromFloat64 returns the floating point number corresponding to the IEEE 754 binary representation of f.
func (Float16) Compare ¶ added in v0.2.0
Compare compares x and y and returns:
-1 if x < y 0 if x == y (incl. -0 == 0, -Inf == -Inf, and +Inf == +Inf) +1 if x > y
a NaN is considered less than any non-NaN, and two NaNs are equal.
func (Float16) Eq ¶ added in v0.2.0
Eq returns a == b. NaNs are not equal to anything, including NaN.
func (Float16) Format ¶ added in v0.4.0
Format implements fmt.Formatter.
func (Float16) Ge ¶ added in v0.2.0
Ge returns a >= b.
Special cases are:
Ge(x, NaN) == false Ge(NaN, x) == false
func (Float16) Gt ¶ added in v0.2.0
Gt returns a > b.
Special cases are:
Gt(x, NaN) == false Gt(NaN, x) == false
func (Float16) 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 (Float16) Le ¶ added in v0.2.0
Le returns a <= b.
Special cases are:
Le(x, NaN) == false Le(NaN, x) == false
func (Float16) Lt ¶ added in v0.2.0
Lt returns a < b.
Special cases are:
Lt(NaN, x) == false Lt(x, NaN) == false
func (Float16) Ne ¶ added in v0.2.0
Ne returns a != b. NaNs are not equal to anything, including NaN.
func (Float16) Sqrt ¶ added in v0.4.0
Sqrt returns the square root of x.
Special cases are:
Sqrt(+Inf) = +Inf Sqrt(±0) = ±0 Sqrt(x < 0) = NaN Sqrt(NaN) = NaN