multiplyNum static method
multiply (without loosing precision). 两个数相乘(防止精度丢失)
Throws ArgumentError if either operand cannot be parsed as a
precise Decimal (e.g. non-finite doubles).
Precision caveat: see addNum. Operands are parsed from their
toString() display value, so already-computed doubles carry their
floating-point drift, and the final .toDouble() can lose precision
for large magnitudes. Prefer multiplyDecString / multiplyDec
with string operands when exactness matters.
Implementation
static double multiplyNum(num a, num b) {
final result = _multiplyDecimal(a.toString(), b.toString());
if (result == null) {
throw ArgumentError(
'multiplyNum: operands must be finite numbers (a=$a, b=$b)',
);
}
return result.toDouble();
}