Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Code snippet incorrect  #1891

@Biki-das

Description

@Biki-das

MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE

What information was incorrect, unhelpful, or incomplete?

`function multiply(x, y) {
if (x * y < Number.MIN_VALUE) {
return 'Process as -Infinity';
}
return (x * y);
}

console.log(multiply(5e-324, 1));
// expected output: 5e-324

console.log(multiply(-1.7976931348623157e+308, 2));
// expected output: Process as -Infinity`

the above code has incorrect return values and expected output

Specific section or headline?
Demo

What did you expect to see?

`function divide(x, y) {
if (x / y < Number.MIN_VALUE) {
return 'Process as 0';
}
return (x / y);
}

console.log(divide(5e-324, 1));
// expected output: 5e-324

console.log(divide(5e-324, 2));
// expected output: Process as 0`

Did you test this? If so, how?
Checked the example in browser

I have already opened a PR, to solve the issue , please look upto it.
here is the PR link-#1890 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions