throw new Error("dnum: decimals cannot be negative");
Does this mean what is says ? The library supports positive decimals only ?
Does this mean what is says ? The library supports positive decimals only ?
Numbers are represented in dnum using a pair of integer + precision decimals. For example, this is the number 1.0 with a precision of 18 decimals:
[1000000000000000000n, 18]
A number cannot have less decimals than none, so this is why this error exists.