Closed Bug 121352 Opened 24 years ago Closed 24 years ago

Number.MIN_VALUE constant should be less-than-zero

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: aoeuaoeu, Assigned: rogerl)

Details

The page below, when loaded in this version of Mozilla (Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.7) Gecko/20011224) as packed in Debian mozilla-browser_2:0.9.7-1 shows the following output: Number.MIN_VALUE = 5e-324 Number.MAX_VALUE = 1.7976931348623157e+308 Number.MIN_VALUE < 0 ? false Number.MAX_VALUE > 0 ? true Ok, according to that, Number.MIN_VALUE is certainly VERY small, but it's still positive. I could mention at least one use for negative numbers and zero in JavaScript :) <html> <head> <title>Number.MIN_VALUE</title> </head> <body> <script type="text/javascript"> document.write('Number.MIN_VALUE = ' + Number.MIN_VALUE + '<br />'); document.write('Number.MAX_VALUE = ' + Number.MAX_VALUE + '<br />'); document.write('Number.MIN_VALUE < 0 ? ' + (Number.MIN_VALUE < 0) + '<br />'); document.write('Number.MAX_VALUE > 0 ? ' + (Number.MAX_VALUE > 0) + '<br />'); </script> </body> </html>
Doesn't the spec specifically say that Number.MIN_VALUE is supposed to be number closest to zero that is not negative that is representable by JS? That number (5e-324) looks correct, IIRC.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Marking Verified. Christopher, thank you for researching this! Javier, thank you for this report; I wasn't aware of this fact - Here is what the ECMA-262 spec (Edition 3 Final) says: 15.7.3.3 Number.MIN_VALUE The value of Number.MIN_VALUE is the smallest positive value of the number type, which is approximately 5 × 10^-324 This spec is available at http://www.mozilla.org/js/language/
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.