We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * 精确乘法 */ function times(num1, num2) { // var num1Changed = Number(num1.toString().replace('.', '')); // var num2Changed = Number(num2.toString().replace('.', '')); // var baseNum = digitLength(num1) + digitLength(num2); var dl1 = digitLength(num1); var dl2 = digitLength(num2); var num1Changed = num1 * Math.pow(10, dl1); var num2Changed = num2 * Math.pow(10, dl2); var baseNum = dl1 + dl2; return num1Changed * num2Changed / Math.pow(10, baseNum); } /** * 精确除法 */ function divide(num1, num2) { // var num1Changed = Number(num1.toString().replace('.', '')); // var num2Changed = Number(num2.toString().replace('.', '')); var dl1 = digitLength(num1); var dl2 = digitLength(num2); var num1Changed = num1 * Math.pow(10, dl1); var num2Changed = num2 * Math.pow(10, dl2); return times((num1Changed / num2Changed), Math.pow(10, dl2 - dl1)); }
The text was updated successfully, but these errors were encountered:
Thanks for reporting, fixed by v1.1.6
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: