Documentation ¶
Index ¶
- Variables
- type Num
- func (n Num) Abs() Num
- func (n Num) Add(rhs Num) Num
- func (n Num) Cmp(other Num) int
- func (n Num) Div(rhs Num) Num
- func (n Num) Equal(other Num) bool
- func (f Num) Float32() float32
- func (n Num) Greater(other Num) bool
- func (n Num) GreaterEqual(other Num) bool
- func (n Num) IsInf() bool
- func (n Num) IsNaN() bool
- func (n Num) IsZero() bool
- func (n Num) Less(other Num) bool
- func (n Num) LessEqual(other Num) bool
- func (n Num) Mul(rhs Num) Num
- func (n Num) Negate() Num
- func (f Num) PutLEBytes(dst []byte)
- func (n Num) Sign() int
- func (n Num) Signbit() bool
- func (f Num) String() string
- func (n Num) Sub(rhs Num) Num
- func (f Num) ToLEBytes() []byte
- func (f Num) Uint16() uint16
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxNum = Num{/* contains filtered or unexported fields */} MinNum = MaxNum.Negate() )
Functions ¶
This section is empty.
Types ¶
type Num ¶
type Num struct {
// contains filtered or unexported fields
}
Num represents a half-precision floating point value (float16) stored on 16 bits.
See https://en.wikipedia.org/wiki/Half-precision_floating-point_format for more informations.
func FromLEBytes ¶
func (Num) Cmp ¶
Cmp compares the numbers represented by n and other and returns:
+1 if n > other 0 if n == other -1 if n < other
func (Num) GreaterEqual ¶
GreaterEqual returns true if the value represented by n is >= other
func (Num) PutLEBytes ¶
Click to show internal directories.
Click to hide internal directories.