package float16
import "github.com/apache/arrow-go/v18/arrow/float16"
Index ¶
- Variables
- type Num
- func FromBits(src uint16) Num
- func FromLEBytes(src []byte) Num
- func Inf() Num
- func Max(first Num, rest ...Num) Num
- func Min(first Num, rest ...Num) Num
- func NaN() Num
- func New(f float32) 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
Variables ¶
var ( MaxNum = Num{/* contains filtered or unexported fields */} MinNum = MaxNum.Negate() )
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 FromBits ¶
func FromLEBytes ¶
func Inf ¶
func Inf() Num
func Max ¶
Max returns the largest Decimal128 that was passed in the arguments
func Min ¶
Min returns the smallest Decimal128 that was passed in the arguments
func NaN ¶
func NaN() Num
func New ¶
New creates a new half-precision floating point value from the provided float32 value.
func (Num) Abs ¶
func (Num) Add ¶
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) Div ¶
func (Num) Equal ¶
Equal returns true if the value represented by n is == other
func (Num) Float32 ¶
func (Num) Greater ¶
Greater returns true if the value represented by n is > other
func (Num) GreaterEqual ¶
GreaterEqual returns true if the value represented by n is >= other
func (Num) IsInf ¶
func (Num) IsNaN ¶
func (Num) IsZero ¶
func (Num) Less ¶
Less returns true if the value represented by n is < other
func (Num) LessEqual ¶
LessEqual returns true if the value represented by n is <= other
func (Num) Mul ¶
func (Num) Negate ¶
func (Num) PutLEBytes ¶
func (Num) Sign ¶
func (Num) Signbit ¶
func (Num) String ¶
func (Num) Sub ¶
func (Num) ToLEBytes ¶
func (Num) Uint16 ¶
Source Files ¶
- Version
- v18.2.0 (latest)
- Published
- Mar 12, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 3 days ago –
Tools for package owners.