/ Published in: JavaScript

Max value for Javascript numbers is: 9007199254740992
This function performs a modulo on numbers bigger than that.
"aNumStr" is the number (as string) you want to devide.
"aDiv" is the number you want to devide by.
This function performs a modulo on numbers bigger than that.
"aNumStr" is the number (as string) you want to devide.
"aDiv" is the number you want to devide by.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function modulo( aNumStr, aDiv) { var tmp = ""; var i, r; for ( i=0; i<aNumStr.length ; i++) { tmp += aNumStr.charAt( i); r = tmp % aDiv; tmp = r.toString( 10); } return tmp / 1; }
Comments
