Skip to content

Commit b0be3ce

Browse files
committed
doc rewording for clarity
1 parent 3665ef7 commit b0be3ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/money.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,8 +1998,8 @@ defmodule Money do
19981998
subtract and round that portion's value from the current remaining amount.
19991999
20002000
eg. with [2, 1] as portions and $1 to spread, we calculate that 2/3 of the amount
2001-
should remain after `1` receives its portion, so we subtract an unrounded Money amount of
2002-
0.666666, and we round it (to 0.33). Then $1.00 - 0.33 is the new remaining amount.
2001+
should remain after `1` receives its portion, so we subtract the unrounded Money amount of
2002+
0.666666, and we round the share to $0.33. Then $1.00 - 0.33 is the new remaining amount.
20032003
This approach avoids numerical instability by using the expected remaining amount,
20042004
rather than summing up values as they are doled out.
20052005

0 commit comments

Comments
 (0)