65
rated 0 times
[
71]
[
6]
/ answers: 1 / hits: 17079
/ 11 Years ago, wed, july 24, 2013, 12:00:00
When I do this:
var x = parseInt(–2147483648);
console.log(x);
I get the value as:
NaN
Why does this happen?
I want to test if a number is in the range of C (int), so I am doing the above, but it does not work. Also, I want to do this for C (long), is there a way to this?
For example:
If I do:
var x = parseInt(-9223372036854775808);
console.log(x);
Now, I know that (-+)2^53 is the limit of numbers in Javascript. Is there some other way to test if the given value in a form is actually in the range of long or int?
More From » nan