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

Rematch should probably use isequal instead of == for floating-point types #35

Open
gafter opened this issue Mar 31, 2023 · 3 comments
Open

Comments

@gafter
Copy link

gafter commented Mar 31, 2023

This:

using Rematch
nan = 0.0 / 0.0
f(x) = @match x begin
    [a,a] => :same
    [a,b] => :different
    _ => :other
end
println(f([nan, nan]))

prints "different".

@jerlich
Copy link

jerlich commented Jul 27, 2023

@gafter
Copy link
Author

gafter commented Jul 31, 2023

@jerlich I assume you provided that link in support of the bug report?

FYI, there is a revision of this package at https://github.com/JuliaServices/Rematch2.jl that I am preparing as a new release of https://github.com/JuliaServices/Match.jl. It addresses this any many other issues in both Match.jl and Rematch.jl.

@jerlich
Copy link

jerlich commented Aug 1, 2023

Yes. That discourse discussion explains why Nan don't always equal nan.

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

No branches or pull requests

2 participants