Skip to content

Commit

Permalink
Fix incorrect Number.MIN_VALUE value (#2682)
Browse files Browse the repository at this point in the history
This will fix the remaining test of the `multiplication` and `division` test suite

It changes the following:
- Change `Number.MIN_VALUE` from `f64::MIN_POSITIVE` to `5e-324` value
  • Loading branch information
HalidOdat committed Mar 16, 2023
1 parent c9ae4dc commit 4d121e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion boa_engine/src/builtins/number/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl Number {
///
/// [spec]: https://tc39.es/ecma262/#sec-number.min_value
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE
pub(crate) const MIN_VALUE: f64 = f64::MIN_POSITIVE;
pub(crate) const MIN_VALUE: f64 = 5e-324;

/// This function returns a `JsResult` of the number `Value`.
///
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/builtins/number/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fn number_constants() {
TestAction::assert_eq("Number.MAX_SAFE_INTEGER", Number::MAX_SAFE_INTEGER),
TestAction::assert_eq("Number.MIN_SAFE_INTEGER", Number::MIN_SAFE_INTEGER),
TestAction::assert_eq("Number.MAX_VALUE", f64::MAX),
TestAction::assert_eq("Number.MIN_VALUE", f64::MIN_POSITIVE),
TestAction::assert_eq("Number.MIN_VALUE", Number::MIN_VALUE),
TestAction::assert_eq("Number.POSITIVE_INFINITY", f64::INFINITY),
TestAction::assert_eq("Number.NEGATIVE_INFINITY", -f64::INFINITY),
]);
Expand Down

0 comments on commit 4d121e5

Please sign in to comment.