Subpar Web Dev February 2016

Why does Number.MIN_VALUE < -1219312 (or any small value) evaluate to false?

I've tried this in multiple browsers and they all evaluate to false! Am I missing something here?

Answers


Zach Snow February 2016

Because Number.MIN_VALUE is the smallest positive value.

(Not sure what people like to link to for reference; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE for instance).


Bill the Lizard February 2016

From MDN:

The Number.MIN_VALUE property represents the smallest positive numeric value representable in JavaScript.

The MIN_VALUE property is the number closest to 0, not the most negative number, that JavaScript can represent.

Number.MIN_VALUE is a really small decimal value, not a really negative value.

Post Status

Asked in February 2016
Viewed 1,952 times
Voted 13
Answered 2 times

Search




Leave an answer