mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-05-21 11:41:25 +00:00
Add min. normalized positive value (MIN_POSITIVE_VALUE) for floats (#50)
This commit is contained in:
parent
13ed832c5d
commit
477669d7a3
4
std/assembly.d.ts
vendored
4
std/assembly.d.ts
vendored
@ -103,6 +103,8 @@ declare function f32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64
|
|||||||
declare namespace f32 {
|
declare namespace f32 {
|
||||||
export const MIN_VALUE: f32;
|
export const MIN_VALUE: f32;
|
||||||
export const MAX_VALUE: f32;
|
export const MAX_VALUE: f32;
|
||||||
|
/** Smallest normalized positive value */
|
||||||
|
export const MIN_POSITIVE_VALUE: f32;
|
||||||
/** Smallest safely representable integer value. */
|
/** Smallest safely representable integer value. */
|
||||||
export const MIN_SAFE_INTEGER: f32;
|
export const MIN_SAFE_INTEGER: f32;
|
||||||
/** Largest safely representable integer value. */
|
/** 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 {
|
declare namespace f64 {
|
||||||
export const MIN_VALUE: f64;
|
export const MIN_VALUE: f64;
|
||||||
export const MAX_VALUE: f64;
|
export const MAX_VALUE: f64;
|
||||||
|
/** Smallest normalized positive value */
|
||||||
|
export const MIN_POSITIVE_VALUE: f64;
|
||||||
/** Smallest safely representable integer value. */
|
/** Smallest safely representable integer value. */
|
||||||
export const MIN_SAFE_INTEGER: f64;
|
export const MIN_SAFE_INTEGER: f64;
|
||||||
/** Largest safely representable integer value. */
|
/** Largest safely representable integer value. */
|
||||||
|
@ -214,6 +214,7 @@ declare function f32(value: void): f32;
|
|||||||
namespace f32 {
|
namespace f32 {
|
||||||
export const MIN_VALUE: f32 = -3.40282347e+38;
|
export const MIN_VALUE: f32 = -3.40282347e+38;
|
||||||
export const MAX_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 MIN_SAFE_INTEGER: f32 = -16777215;
|
||||||
export const MAX_SAFE_INTEGER: f32 = 16777215;
|
export const MAX_SAFE_INTEGER: f32 = 16777215;
|
||||||
export const EPSILON: f32 = 1.19209290e-07;
|
export const EPSILON: f32 = 1.19209290e-07;
|
||||||
@ -225,6 +226,7 @@ declare function f64(value: void): f64;
|
|||||||
namespace f64 {
|
namespace f64 {
|
||||||
export const MIN_VALUE: f64 = -1.7976931348623157e+308;
|
export const MIN_VALUE: f64 = -1.7976931348623157e+308;
|
||||||
export const MAX_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 MIN_SAFE_INTEGER: f64 = -9007199254740991;
|
||||||
export const MAX_SAFE_INTEGER: f64 = 9007199254740991;
|
export const MAX_SAFE_INTEGER: f64 = 9007199254740991;
|
||||||
export const EPSILON: f64 = 2.2204460492503131e-16;
|
export const EPSILON: f64 = 2.2204460492503131e-16;
|
||||||
|
8
std/portable.d.ts
vendored
8
std/portable.d.ts
vendored
@ -83,6 +83,10 @@ declare namespace bool {
|
|||||||
/** Converts any other numeric value to a 32-bit float. */
|
/** 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 function f32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f32;
|
||||||
declare namespace 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. */
|
/** Smallest safely representable integer value. */
|
||||||
export const MIN_SAFE_INTEGER: f32;
|
export const MIN_SAFE_INTEGER: f32;
|
||||||
/** Largest safely representable integer value. */
|
/** Largest safely representable integer value. */
|
||||||
@ -93,6 +97,10 @@ declare namespace f32 {
|
|||||||
/** Converts any other numeric value to a 64-bit float. */
|
/** 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 function f64(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f64;
|
||||||
declare namespace 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. */
|
/** Smallest safely representable integer value. */
|
||||||
export const MIN_SAFE_INTEGER: f64;
|
export const MIN_SAFE_INTEGER: f64;
|
||||||
/** Largest safely representable integer value. */
|
/** Largest safely representable integer value. */
|
||||||
|
@ -56,6 +56,7 @@ Object.defineProperties(
|
|||||||
, {
|
, {
|
||||||
"MIN_VALUE": { value: Math.fround(-3.40282347e+38), writable: false },
|
"MIN_VALUE": { value: Math.fround(-3.40282347e+38), writable: false },
|
||||||
"MAX_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 },
|
"MIN_SAFE_INTEGER": { value: -16777215, writable: false },
|
||||||
"MAX_SAFE_INTEGER": { value: 16777215, writable: false },
|
"MAX_SAFE_INTEGER": { value: 16777215, writable: false },
|
||||||
"EPSILON": { value: Math.fround(1.19209290e-07), 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 },
|
"MIN_VALUE": { value: -1.7976931348623157e+308, writable: false },
|
||||||
"MAX_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 },
|
"MIN_SAFE_INTEGER": { value: -9007199254740991, writable: false },
|
||||||
"MAX_SAFE_INTEGER": { value: 9007199254740991, writable: false },
|
"MAX_SAFE_INTEGER": { value: 9007199254740991, writable: false },
|
||||||
"EPSILON": { value: 2.2204460492503131e-16, writable: false }
|
"EPSILON": { value: 2.2204460492503131e-16, writable: false }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user