float16

package
v0.0.0-...-164552c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromUint64RoundUp

func FromUint64RoundUp(v uint64) (uint16, bool)

FromUint64RoundUp converts an integer value to its corresponding 16-bit floating-point value, rounding up if needed.

Note that the format used differs from IEEE 754's half-precision floating-point format. There is no sign bit, meaning that the significand is 11 bits. The exponent bias is chosen so that the smallest subnormal value corresponds to integer value 1. There is no support for expressing infinity/NaN.

func ToUint64

func ToUint64(v uint16) uint64

ToUint64 converts a 16-bit floating-point value to its corresponding integer value. This function is the inverse of Uint64ToFloat16RoundUp.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL