UNPKG

fp16

Version:

Half-precision 16-bit floating point numbers

20 lines (19 loc) 716 B
export declare const Precision: { readonly Exact: 0; readonly Inexact: 1; readonly Underflow: 2; readonly Overflow: 3; }; export type Precision = (typeof Precision)[keyof typeof Precision]; /** * * @param value a float64 value * @returns a Precision enum indicating whether conversion to float16 will overflow, underflow, round inexactly, or preserve the exact value */ export declare function getFloat16Precision(value: number): Precision; /** * * @param value a float64 value * @returns a Precision enum indicating whether conversion to float32 will overflow, underflow, round inexactly, or preserve the exact value */ export declare function getFloat32Precision(value: number): Precision;