Opened 7 years ago

Closed 7 years ago

#17714 closed defect (fixed)

Fix a bug in sorting RealSets

Reported by: yzh Owned by:
Priority: major Milestone: sage-6.6
Component: calculus Keywords: real_set
Cc: tscrim, vbraun Merged in:
Authors: Yuan Zhou Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: 97e50b5 (Commits, GitHub, GitLab) Commit: 97e50b50c9189fc9ae82777af7b879f1b60fd86e
Dependencies: Stopgaps:

Status badges


Find a bug:

sage: RealSet((0, 1),[1, 1],(1, 2))
(0, 1) + [1, 2)

should return

(0, 2)

This can be fixed by a modification in RealInterval.__cmp__: when comparing two intervals with the same lower bound, put lower_closed before lower_open. i.e. [a, b] < (a, c].

Change History (6)

comment:1 Changed 7 years ago by yzh

  • Authors set to Yuan Zhou
  • Keywords real_set added

comment:2 Changed 7 years ago by kcrisman

  • Cc vbraun added

comment:3 Changed 7 years ago by rws

  • Status changed from new to needs_review

Thanks. Please always include a doctest, and set needs review. I will do it this time and do the review, as well.

comment:4 Changed 7 years ago by rws

  • Branch changed from u/yzh/test_branch to u/rws/test_branch

comment:5 Changed 7 years ago by rws

  • Commit changed from 20cbe14a42db5b71f64d54d2f1030e8df68a5ebb to 97e50b50c9189fc9ae82777af7b879f1b60fd86e
  • Milestone changed from sage-6.5 to sage-6.6
  • Reviewers set to Ralf Stephan
  • Status changed from needs_review to positive_review

This looks fine, tests OK with make ptestlong.

New commits:

97e50b517714 reviewer's patch: add doctest, cosmetics

comment:6 Changed 7 years ago by vbraun

  • Branch changed from u/rws/test_branch to 97e50b50c9189fc9ae82777af7b879f1b60fd86e
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.