You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
big.Int instances are mutable. Which means that if a caller calls math.MaxBigInt(a, b) and later changes a or b, then what math.MaxBigInt returned could change unexpectedly
Consider the following code
a := big.NewInt(3)
b := big.NewInt(5)
c := math.MaxBigInt(a, b) // c = 5, c and b point to the same big.Int
b.SetInt64(2)
// Oops, now c = 2, not 5. Caller won't be expecting this.
Although it would be slower, consider having math.MaxBigInt() and similar functions return a copy of the max value rather than the actual max value.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
big.Int instances are mutable. Which means that if a caller calls math.MaxBigInt(a, b) and later changes a or b, then what math.MaxBigInt returned could change unexpectedly
Consider the following code
Although it would be slower, consider having math.MaxBigInt() and similar functions return a copy of the max value rather than the actual max value.
The text was updated successfully, but these errors were encountered: