float16

package
v0.0.0-...-20d847b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float16ToUint64

func Float16ToUint64(v uint16) uint64

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

func Uint64ToFloat16RoundUp

func Uint64ToFloat16RoundUp(v uint64) (uint16, bool)

Uint64ToFloat16RoundUp 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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