Versions in this module Expand all Collapse all v0 v0.1.0 Jul 28, 2025 Changes in this version + const ExponentBias + const ExponentInfinity + const ExponentLen + const ExponentMask + const ExponentMax + const ExponentMin + const ExponentNormalMax + const ExponentNormalMin + const ExponentZero + const Float32ExponentBias + const Float32ExponentLen + const Float32MantissaLen + const MantissaLen + const MantissaMask + const SignMask + const Version + const VersionMajor + const VersionMinor + const VersionPatch + var DefaultArithmeticMode = ModeIEEEArithmetic + var DefaultConversionMode = ModeIEEE + var DefaultRounding = RoundNearestEven + var DefaultRoundingMode = RoundNearestEven + var Deg2Rad = ToFloat16(float32(math.Pi / 180.0)) + var E = ToFloat16(float32(math.E)) + var ErrDivByZeroError = &Float16Error + var ErrInfinityError = &Float16Error + var ErrNaNError = &Float16Error + var ErrOverflowError = &Float16Error + var ErrUnderflowError = &Float16Error + var Five16 = ToFloat16(5.0) + var Four16 = ToFloat16(4.0) + var Half16 = ToFloat16(0.5) + var Ln10 = ToFloat16(float32(math.Ln10)) + var Ln2 = ToFloat16(float32(math.Ln2)) + var Log10E = ToFloat16(float32(math.Log10E)) + var Log2E = ToFloat16(float32(math.Log2E)) + var NaN16 = QuietNaN + var NegInf = NegativeInfinity + var One16 = ToFloat16(1.0) + var Phi = ToFloat16(float32(math.Phi)) + var Pi = ToFloat16(float32(math.Pi)) + var PosInf = PositiveInfinity + var Quarter16 = ToFloat16(0.25) + var Rad2Deg = ToFloat16(float32(180.0 / math.Pi)) + var Sqrt2 = ToFloat16(float32(math.Sqrt2)) + var SqrtE = ToFloat16(float32(math.SqrtE)) + var SqrtPhi = ToFloat16(float32(math.SqrtPhi)) + var SqrtPi = ToFloat16(float32(math.SqrtPi)) + var Ten16 = ToFloat16(10.0) + var Third16 = ToFloat16(1.0 / 3.0) + var Three16 = ToFloat16(3.0) + var Two16 = ToFloat16(2.0) + var Zero16 = PositiveZero + func Configure(cfg *Config) + func DebugInfo() map[string]interface + func Equal(a, b Float16) bool + func GetBenchmarkOperations() map[string]BenchmarkOperation + func GetMemoryUsage() int + func GetVersion() string + func Greater(a, b Float16) bool + func GreaterEqual(a, b Float16) bool + func IsFinite(f Float16) bool + func IsInf(f Float16, sign int) bool + func IsNaN(f Float16) bool + func IsNormal(f Float16) bool + func IsSubnormal(f Float16) bool + func Less(a, b Float16) bool + func LessEqual(a, b Float16) bool + func Signbit(f Float16) bool + func ToSlice32(f16s []Float16) []float32 + func ToSlice64(f16s []Float16) []float64 + func ValidateSliceLength(a, b []Float16) error + type ArithmeticMode int + const ModeExactArithmetic + const ModeFastArithmetic + const ModeIEEEArithmetic + type BenchmarkOperation func(Float16, Float16) Float16 + type Config struct + DefaultArithmeticMode ArithmeticMode + DefaultConversionMode ConversionMode + DefaultRoundingMode RoundingMode + EnableFastMath bool + func DefaultConfig() *Config + func GetConfig() *Config + type ConversionMode int + const ModeExact + const ModeFast + const ModeIEEE + const ModeStrict + type ErrorCode int + const ErrDivisionByZero + const ErrInexact + const ErrInfinity + const ErrInvalidOperation + const ErrNaN + const ErrOverflow + const ErrUnderflow + type Float16 uint16 + const LargestSubnormal + const MaxValue + const MinValue + const NegativeInfinity + const NegativeQNaN + const NegativeZero + const PositiveInfinity + const PositiveZero + const QuietNaN + const SignalingNaN + const SmallestNormal + const SmallestSubnormal + func Abs(f Float16) Float16 + func Acos(f Float16) Float16 + func Add(a, b Float16) Float16 + func AddSlice(a, b []Float16) []Float16 + func AddWithMode(a, b Float16, mode ArithmeticMode, rounding RoundingMode) (Float16, error) + func Asin(f Float16) Float16 + func Atan(f Float16) Float16 + func Atan2(y, x Float16) Float16 + func Cbrt(f Float16) Float16 + func Ceil(f Float16) Float16 + func Clamp(f, min, max Float16) Float16 + func CopySign(f, sign Float16) Float16 + func Cos(f Float16) Float16 + func Cosh(f Float16) Float16 + func Dim(f, g Float16) Float16 + func Div(a, b Float16) Float16 + func DivSlice(a, b []Float16) []Float16 + func DivWithMode(a, b Float16, mode ArithmeticMode, rounding RoundingMode) (Float16, error) + func DotProduct(a, b []Float16) Float16 + func Erf(f Float16) Float16 + func Erfc(f Float16) Float16 + func Exp(f Float16) Float16 + func Exp10(f Float16) Float16 + func Exp2(f Float16) Float16 + func FastAdd(a, b Float16) Float16 + func FastMul(a, b Float16) Float16 + func Floor(f Float16) Float16 + func Frexp(f Float16) (frac Float16, exp int) + func FromBits(bits uint16) Float16 + func FromFloat32(f32 float32) Float16 + func FromFloat64(f64 float64) Float16 + func FromFloat64WithMode(f64 float64, convMode ConversionMode, roundMode RoundingMode) (Float16, error) + func FromInt(i int) Float16 + func FromInt32(i int32) Float16 + func FromInt64(i int64) Float16 + func FromSlice64(f64s []float64) []Float16 + func Gamma(f Float16) Float16 + func Hypot(f, g Float16) Float16 + func Inf(sign int) Float16 + func J0(f Float16) Float16 + func J1(f Float16) Float16 + func Ldexp(frac Float16, exp int) Float16 + func Lerp(a, b, t Float16) Float16 + func Lgamma(f Float16) (Float16, int) + func Log(f Float16) Float16 + func Log10(f Float16) Float16 + func Log2(f Float16) Float16 + func Max(a, b Float16) Float16 + func Min(a, b Float16) Float16 + func Mod(f, divisor Float16) Float16 + func Modf(f Float16) (integer, frac Float16) + func Mul(a, b Float16) Float16 + func MulSlice(a, b []Float16) []Float16 + func MulWithMode(a, b Float16, mode ArithmeticMode, rounding RoundingMode) (Float16, error) + func NaN() Float16 + func NextAfter(f, g Float16) Float16 + func Norm2(s []Float16) Float16 + func One() Float16 + func Parse(s string) (Float16, error) + func Pow(f, exp Float16) Float16 + func Remainder(f, divisor Float16) Float16 + func Round(f Float16) Float16 + func RoundToEven(f Float16) Float16 + func ScaleSlice(s []Float16, scalar Float16) []Float16 + func Sign(f Float16) Float16 + func Sin(f Float16) Float16 + func Sinh(f Float16) Float16 + func Sqrt(f Float16) Float16 + func Sub(a, b Float16) Float16 + func SubSlice(a, b []Float16) []Float16 + func SubWithMode(a, b Float16, mode ArithmeticMode, rounding RoundingMode) (Float16, error) + func SumSlice(s []Float16) Float16 + func Tan(f Float16) Float16 + func Tanh(f Float16) Float16 + func ToFloat16(f32 float32) Float16 + func ToFloat16WithMode(f32 float32, convMode ConversionMode, roundMode RoundingMode) (Float16, error) + func ToSlice16(f32s []float32) []Float16 + func ToSlice16WithMode(f32s []float32, convMode ConversionMode, roundMode RoundingMode) ([]Float16, []error) + func Trunc(f Float16) Float16 + func VectorAdd(a, b []Float16) []Float16 + func VectorMul(a, b []Float16) []Float16 + func Y0(f Float16) Float16 + func Y1(f Float16) Float16 + func Zero() Float16 + func (f Float16) Abs() Float16 + func (f Float16) Bits() uint16 + func (f Float16) Class() FloatClass + func (f Float16) CopySign(sign Float16) Float16 + func (f Float16) GoString() string + func (f Float16) IsFinite() bool + func (f Float16) IsInf(sign int) bool + func (f Float16) IsNaN() bool + func (f Float16) IsNormal() bool + func (f Float16) IsSubnormal() bool + func (f Float16) IsZero() bool + func (f Float16) Neg() Float16 + func (f Float16) Sign() int + func (f Float16) Signbit() bool + func (f Float16) String() string + func (f Float16) ToFloat32() float32 + func (f Float16) ToFloat64() float64 + func (f Float16) ToInt() int + func (f Float16) ToInt32() int32 + func (f Float16) ToInt64() int64 + type Float16Error struct + Code ErrorCode + Msg string + Op string + Value interface{} + func (e *Float16Error) Error() string + type FloatClass int + const ClassNegativeInfinity + const ClassNegativeNormal + const ClassNegativeSubnormal + const ClassNegativeZero + const ClassPositiveInfinity + const ClassPositiveNormal + const ClassPositiveSubnormal + const ClassPositiveZero + const ClassQuietNaN + const ClassSignalingNaN + func FpClassify(f Float16) FloatClass + type RoundingMode int + const RoundNearestAway + const RoundNearestEven + const RoundTowardNegative + const RoundTowardPositive + const RoundTowardZero + type SliceStats struct + Length int + Max Float16 + Mean Float16 + Min Float16 + Sum Float16 + func ComputeSliceStats(s []Float16) SliceStats