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
I want to check that a serialization an f64 that is stored in radians to degrees. When i convert into and from radians, there is a minor expected difference in the value.
Example: panicked at 'expected Token::F64(59.949999999999996) but serialized as F64(59.95)
Could not figure out how to fix this.
The text was updated successfully, but these errors were encountered:
I think you would need to put the computation in the test to match the computation that you expect the Serialize impl(s) to perform, i.e. instead of Token::F64(/* float literal */) you would specify Token::F64(/* the arithmetic computation */). This way the float will match exactly if the Serialize impl is performing the computation that you expect.
I want to check that a serialization an f64 that is stored in radians to degrees. When i convert into and from radians, there is a minor expected difference in the value.
Example:
panicked at 'expected Token::F64(59.949999999999996) but serialized as F64(59.95)
Could not figure out how to fix this.
The text was updated successfully, but these errors were encountered: