/ 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.
Expand |
Embed | Plain Text
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; }
You need to login to post a comment.
