The first number. 第一个数字
The second number. 第二个数字
Optionalprecision: numberThe precision of the result. 结果的精度
The quotient of the two numbers. 两个数字的商
decimalDivide(0.1, 0.2) // => 0.5
decimalDivide(1.5, 2.3) // => 0.6521739130434783
decimalDivide(10.001, 20) // => 0.5005
The current implementation only considers predictable scenarios and cannot guarantee precise calculation results under all circumstances; For calculation scenarios involving large numbers, finance, science, etc., it is recommended to use open-source libraries such as decimal.js to handle mathematical operations.
当前实现仅考虑可预期的场景,无法保证在所有情况下都能精确计算结果; 涉及到大数、金融、科学等计算场景,建议使用 decimal.js 等开源库来处理数学运算
Precisely divide two floating-point numbers
精确相除两个数