Closed jbardin closed 3 years ago
Use Float.Copy in AsBigFloat to ensure that there is no shared data between the mutable *big.Float and the cty.Value internal state.
Float.Copy
AsBigFloat
*big.Float
cty.Value
Without the Copy, the given test will output:
original value changed from cty.NumberFloatVal(1.9) to cty.NumberIntVal(1)
Use
Float.Copy
inAsBigFloat
to ensure that there is no shared data between the mutable*big.Float
and thecty.Value
internal state.Without the Copy, the given test will output: