Function: multiply()
ts
function multiply(a, b): number;Multiplies two numbers with fixed precision. 高精度乘法运算,避免浮点数误差。
Parameters
| Parameter | Type | Description |
|---|---|---|
a | number | The first number to multiply / 第一个乘数 |
b | number | The second number to multiply / 第二个乘数 |
Returns
number
The result of multiplying the two numbers / 乘法结果
Example
typescript
multiply(0.1, 0.2) // => 0.02 (not 0.020000000000000004)
multiply(1.23, 4.56) // => 5.6088Since
1.0.0