-
Notifications
You must be signed in to change notification settings - Fork 494
Open
Description
Currently, an error occurs when zero arguments is passed to Decimal.sum.
const decimals = []
Decimal.sum(...decimals) // Error occursLodash's _.sum and Ramda's R.sum returns 0 when passed an array with zero elements.
const numbers = []
_.sum(numbers) // => 0
R.sum(numbers) // => 0Similarly, it would be nice if Decimal.sum returned new Decimal(0) when called with zero arguments.
const decimals = []
Decimal.sum(...decimals) // => new Decimal(0)michaelhays, zvin, Karl-EdwardJeanMehu, ParallelUniv3rse, balek and 3 more
Metadata
Metadata
Assignees
Labels
No labels