-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
From here: ericlagergren/decimal#138
My package divides (*Rat).Num
by (*Rat).Denom
to produce a decimal number. It turns out that (*Rat).Denom
lazily sets its denominator, meaning it cannot be used concurrently.
Since the receiver is x
not z
, I assumed that the method simply read the denominator.
The receiver name should be updated to indicate side effects and/or the documentation for big.Rat
should mention this side effect. I assume that the 7 years this has spent in the tree is too long to be reverted 😄. And, at any rate, not materializing the denominator can save allocations for whole numbers, which is a good thing.
I can send a CL if you want.
wphan and yarco
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.