diff --git a/std/assembly.d.ts b/std/assembly.d.ts index ab206faa..5897b6fc 100644 --- a/std/assembly.d.ts +++ b/std/assembly.d.ts @@ -103,6 +103,8 @@ declare function f32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 declare namespace f32 { export const MIN_VALUE: f32; export const MAX_VALUE: f32; + /** Smallest normalized positive value */ + export const MIN_POSITIVE_VALUE: f32; /** Smallest safely representable integer value. */ export const MIN_SAFE_INTEGER: f32; /** Largest safely representable integer value. */ @@ -115,6 +117,8 @@ declare function f64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 declare namespace f64 { export const MIN_VALUE: f64; export const MAX_VALUE: f64; + /** Smallest normalized positive value */ + export const MIN_POSITIVE_VALUE: f64; /** Smallest safely representable integer value. */ export const MIN_SAFE_INTEGER: f64; /** Largest safely representable integer value. */ diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts index 16732d93..5960d0d2 100644 --- a/std/assembly/builtins.ts +++ b/std/assembly/builtins.ts @@ -214,6 +214,7 @@ declare function f32(value: void): f32; namespace f32 { export const MIN_VALUE: f32 = -3.40282347e+38; export const MAX_VALUE: f32 = 3.40282347e+38; + export const MIN_POSITIVE_VALUE: f32 = 1.175494351e-38; export const MIN_SAFE_INTEGER: f32 = -16777215; export const MAX_SAFE_INTEGER: f32 = 16777215; export const EPSILON: f32 = 1.19209290e-07; @@ -225,6 +226,7 @@ declare function f64(value: void): f64; namespace f64 { export const MIN_VALUE: f64 = -1.7976931348623157e+308; export const MAX_VALUE: f64 = 1.7976931348623157e+308; + export const MIN_POSITIVE_VALUE: f64 = 2.2250738585072014e-308; export const MIN_SAFE_INTEGER: f64 = -9007199254740991; export const MAX_SAFE_INTEGER: f64 = 9007199254740991; export const EPSILON: f64 = 2.2204460492503131e-16; diff --git a/std/portable.d.ts b/std/portable.d.ts index 42d53f61..7146569a 100644 --- a/std/portable.d.ts +++ b/std/portable.d.ts @@ -83,6 +83,10 @@ declare namespace bool { /** Converts any other numeric value to a 32-bit float. */ declare function f32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f32; declare namespace f32 { + export const MIN_VALUE: f32; + export const MAX_VALUE: f32; + /** Smallest normalized positive value */ + export const MIN_POSITIVE_VALUE: f32; /** Smallest safely representable integer value. */ export const MIN_SAFE_INTEGER: f32; /** Largest safely representable integer value. */ @@ -93,6 +97,10 @@ declare namespace f32 { /** Converts any other numeric value to a 64-bit float. */ declare function f64(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f64; declare namespace f64 { + export const MIN_VALUE: f64; + export const MAX_VALUE: f64; + /** Smallest normalized positive value */ + export const MIN_POSITIVE_VALUE: f64; /** Smallest safely representable integer value. */ export const MIN_SAFE_INTEGER: f64; /** Largest safely representable integer value. */ diff --git a/std/portable.js b/std/portable.js index 3207d0ca..1d756303 100644 --- a/std/portable.js +++ b/std/portable.js @@ -56,6 +56,7 @@ Object.defineProperties( , { "MIN_VALUE": { value: Math.fround(-3.40282347e+38), writable: false }, "MAX_VALUE": { value: Math.fround(3.40282347e+38), writable: false }, + "MIN_POSITIVE_VALUE": { value: Math.fround(1.175494351e-38), writable: false }, "MIN_SAFE_INTEGER": { value: -16777215, writable: false }, "MAX_SAFE_INTEGER": { value: 16777215, writable: false }, "EPSILON": { value: Math.fround(1.19209290e-07), writable: false } @@ -66,6 +67,7 @@ Object.defineProperties( , { "MIN_VALUE": { value: -1.7976931348623157e+308, writable: false }, "MAX_VALUE": { value: 1.7976931348623157e+308, writable: false }, + "MIN_POSITIVE_VALUE": { value: 2.2250738585072014e-308 , writable: false }, "MIN_SAFE_INTEGER": { value: -9007199254740991, writable: false }, "MAX_SAFE_INTEGER": { value: 9007199254740991, writable: false }, "EPSILON": { value: 2.2204460492503131e-16, writable: false }