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

Floats with different representation are equal #23578

Open
eendebakpt opened this issue Jun 4, 2022 · 1 comment
Open

Floats with different representation are equal #23578

eendebakpt opened this issue Jun 4, 2022 · 1 comment

Comments

@eendebakpt
Copy link
Contributor

A minimal example:

from sympy import sin, cos, re, im, Float

n = sin(1)**2 + cos(1)**2 - 1
w=n.n(2)
print(f'w: {repr(w)}: type {type(w)} mpf {w._mpf_}')

w2=Float((1, 1, -365, 1))
print(f'w2: {(w2)}: type {type(w2)} mpf {w2._mpf_}')

print(f'equal? {w==w2}')

If the representations of w and w2 differ, the result of w==w2 should not be True

Found when analysing #23565

@oscarbenjamin

@oscarbenjamin
Copy link
Contributor

See #20033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants