Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proptest_assert_eq may consider NaN == NaN to be false #367

Open
erichulburd opened this issue Apr 22, 2024 · 0 comments · May be fixed by #368
Open

proptest_assert_eq may consider NaN == NaN to be false #367

erichulburd opened this issue Apr 22, 2024 · 0 comments · May be fixed by #368

Comments

@erichulburd
Copy link
Collaborator

See the results of this job in MSRV task: https://github.com/rigetti/quil-rs/actions/runs/8790199931/job/24121695036

Test failed: assertion failed: `(left == right)` 
  left: `Number(Complex { re: NaN, im: 0.0 })`, 
 right: `Number(Complex { re: NaN, im: 0.0 })`: Simplified expressions should be equal:
parenthesized aa[0]/sin(pi) ("aa[0]/sin(pi)") extracted from (aa[0]/(sin(pi))) simplified to NaN
vs original aa[0]/sin(pi) ("aa[0]/sin(pi)") simplified to NaN at quil-rs/src/expression/mod.rs:993.
minimal failing input: e = Infix(
    InfixExpression {
        left: Address(
            MemoryReference {
                name: "aa",
                index: 0,
            },
        ),
        operator: Slash,
        right: FunctionCall(
            FunctionCallExpression {
                function: Sine,
                expression: PiConstant,
            },
        ),
    },
)

I've added this test case locally to specific_round_trip_tests, but couldn't reproduce the failure. That being the case, I suppose we can wrap that particular test case to check for the NaN case.

@erichulburd erichulburd linked a pull request Apr 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant