mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 06:21:29 +00:00
Change semantics of f32/f64.MIN_VALUE to match JS's Number.MIN_VALUE
* Also renames MIN_POSITIVE_VALUE to MIN_NORMAL_VALUE * Also adds POSITIVE_INFINITY/NEGATIVE_INFINITY and NaN
This commit is contained in:
@ -147,12 +147,15 @@ export namespace bool {
|
||||
|
||||
@builtin export declare function f32(value: void): f32;
|
||||
export namespace f32 {
|
||||
export const MIN_VALUE = reinterpret<f32>(0xFF7FFFFF); // -0x1.fffffep+127f
|
||||
export const MAX_VALUE = reinterpret<f32>(0x7F7FFFFF); // 0x1.fffffep+127f
|
||||
export const MIN_POSITIVE_VALUE = reinterpret<f32>(0x00800000); // 0x1p-126f
|
||||
export const EPSILON = reinterpret<f32>(0x34000000); // 0x1p-23f
|
||||
export const MIN_VALUE = reinterpret<f32>(0x00000001); // 0x0.000001p+0f
|
||||
export const MAX_VALUE = reinterpret<f32>(0x7F7FFFFF); // 0x1.fffffep+127f
|
||||
export const MIN_NORMAL_VALUE = reinterpret<f32>(0x00800000); // 0x1p-126f
|
||||
export const MIN_SAFE_INTEGER: f32 = -16777215;
|
||||
export const MAX_SAFE_INTEGER: f32 = 16777215;
|
||||
export const EPSILON = reinterpret<f32>(0x34000000); // 0x1p-23f
|
||||
export const POSITIVE_INFINITY: f32 = Infinity;
|
||||
export const NEGATIVE_INFINITY: f32 = -Infinity;
|
||||
export const NaN: f32 = NaN;
|
||||
@builtin export declare function abs(value: f32): f32;
|
||||
@builtin export declare function ceil(value: f32): f32;
|
||||
@builtin export declare function copysign(x: f32, y: f32): f32;
|
||||
@ -169,12 +172,15 @@ export namespace f32 {
|
||||
|
||||
@builtin export declare function f64(value: void): f64;
|
||||
export namespace f64 {
|
||||
export const MIN_VALUE = reinterpret<f64>(0xFFEFFFFFFFFFFFFF); // -0x1.fffffffffffffp+1023
|
||||
export const MAX_VALUE = reinterpret<f64>(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023
|
||||
export const MIN_POSITIVE_VALUE = reinterpret<f64>(0x0010000000000000); // 0x1p-1022
|
||||
export const EPSILON = reinterpret<f64>(0x3CB0000000000000); // 0x1p-52
|
||||
export const MIN_VALUE = reinterpret<f64>(0x0000000000000001); // 0x0.0000000000001p+0
|
||||
export const MAX_VALUE = reinterpret<f64>(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023
|
||||
export const MIN_NORMAL_VALUE = reinterpret<f64>(0x0010000000000000); // 0x1p-1022
|
||||
export const MIN_SAFE_INTEGER: f64 = -9007199254740991;
|
||||
export const MAX_SAFE_INTEGER: f64 = 9007199254740991;
|
||||
export const EPSILON = reinterpret<f64>(0x3CB0000000000000); // 0x1p-52
|
||||
export const POSITIVE_INFINITY: f64 = Infinity;
|
||||
export const NEGATIVE_INFINITY: f64 = -Infinity;
|
||||
export const NaN: f64 = NaN;
|
||||
@builtin export declare function abs(value: f64): f64;
|
||||
@builtin export declare function ceil(value: f64): f64;
|
||||
@builtin export declare function copysign(x: f64, y: f64): f64;
|
||||
|
Reference in New Issue
Block a user