#31665 closed defect (duplicate)

SymbolicRing: wrong comparison

Reported by: zimmerma Owned by:
Priority: critical Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #31424 Stopgaps:

Status badges

Description (last modified by mkoeppe)

consider the following with Sage 9.1 (or 9.3.rc3):

sage: t = log(17179815199/17179869184) + 727717503781781876485802752874818120860129694543334299450155913077668355/231584178474632390847141970017375815706539969331281128078915168015826259279872
sage: v = -53985/17179869184
sage: bool(abs(t) < 1.213*2^-56*v^4)      # wrong
False
sage: R=RealIntervalField(200)
sage: R(t)
1.55578750734428907680358094?e-39
sage: R(1.213*2^-56*v^4)
1.6413230032915689258596928268620690736175285393511912922960995?e-39

It seems the bool evaluation is evaluated in floating-point with insufficient precision to yield a correct result.

Change History (11)

comment:1 Changed 22 months ago by zimmerma

cf #31424

comment:2 Changed 22 months ago by mkoeppe

Description: modified (diff)

same in 9.3.rc3

comment:3 Changed 22 months ago by mkoeppe

Summary: wrong comparisonSymbolicRing: wrong comparison

comment:4 Changed 21 months ago by mkoeppe

Milestone: sage-9.3sage-9.4

Moving to 9.4, as 9.3 has been released.

comment:5 Changed 18 months ago by mkoeppe

Milestone: sage-9.4sage-9.5

comment:6 Changed 14 months ago by mkoeppe

Milestone: sage-9.5sage-9.6

comment:7 Changed 13 months ago by mjo

Dependencies: #31424
Milestone: sage-9.6sage-duplicate/invalid/wontfix

Fixed in #31424.

comment:8 Changed 13 months ago by mjo

Status: newneeds_review

comment:9 Changed 13 months ago by zimmerma

if we now get true with the patch from #31424 (I did not check however), this is ok for me

comment:10 in reply to:  9 Changed 13 months ago by mjo

Replying to zimmerma:

if we now get true with the patch from #31424 (I did not check however), this is ok for me

Yes, and it's included as a doctest there too.

comment:11 Changed 11 months ago by chapoton

Resolution: duplicate
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.