Can anyone tell me how to compare large numbers in javascript?
Something like
var sla = 1263293940000;
var resp = 1263296389700;
if(sla > resp)
{
//do something
}
Can anyone tell me how to compare large numbers in javascript?
Something like
var sla = 1263293940000;
var resp = 1263296389700;
if(sla > resp)
{
//do something
}
Internally all javascript numbers are represented as double-precision floating point numbers. As you've discovered, this causes some rounding errors for very large numbers (and in other places). If you need more precision, you'll need to use a library like the one Alex posted.