symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

isequal of two unit vpa precisions

Open cbm755 opened this issue 1 year ago • 1 comments

I think the isequal behaviour has changed between SymPy 1.12 and the main branch.

With SymPy 1.13.dev:

>> isequal (vpa (1, 16), vpa (1, 32))
ans = 0

But on 1.12:

>> isequal (vpa (1, 64), vpa (1, 32))
ans = 1

In both cases:

>> vpa (1, 32) == vpa (1, 64)
ans = (sym) True
  • what is correct?
  • what has changed upstream?
  • we should add unit tests for whatever we prefer here.

Related: logspace is failing a test b/c of this.

cbm755 avatar Jan 06 '24 01:01 cbm755

Upstream issue: https://github.com/sympy/sympy/issues/26146

Looks like their intention is that Float(1, 32) would not equal to Float(1, 64). Good.

(our == is more like SymPy Eq IIRC).

cbm755 avatar Jan 29 '24 20:01 cbm755