Closed ccpocker closed 1 year ago
When you call eval
on the expression 1 - 0.7
, you get 0.30000000000000004
.
>>> 1 - 0.7
0.30000000000000004
>>> eval("1 - 0.7")
0.30000000000000004
I am going to migrate this issue to a discussion as this is not an omegaconf bug.
I am using omegaconf to implement some complex logic using a YAML file with interpolation. To achieve this, I registered some new resolvers as follows:
My yaml file looks like this:
However, after resolving the YAML file, the output is not as expected. It seems there is a floating point precision issue, and image0 and text0 are overlapping instead of filling up the image. The resulting output is as follows:
My expected output should look like this: