Opened 6 years ago
Closed 6 years ago
#17758 closed defect (duplicate)
Intervals and numpy floats do not compare correctly
Reported by: | f.poloni | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | Jeroen Demeyer | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Comparison operators between real interval field members and numpy float numbers always return false:
sage: import numpy as np sage: RIF(1) <= 2.0 True sage: RIF(1) <= RealNumber(2.0) True sage: RIF(1) <= np.float64(2.0) False
Change History (6)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
I agree, it looks like a duplicate. Sorry for not finding #13386 myself, I was searching only for "interval".
I understand that loading numpy slows down the startup time, but on the other hand this quirky behavior can cause nasty bugs in user code.
comment:3 Changed 6 years ago by
- Milestone changed from sage-6.5 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
comment:4 Changed 6 years ago by
Original reporter here; your proposal sounds good to me, and I am looking forward for your patch to close #18076 to be included in master.
comment:5 Changed 6 years ago by
- Reviewers set to Jeroen Demeyer
- Status changed from needs_review to positive_review
comment:6 Changed 6 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Hello,
See also #13386. The problem is that Sage needs to avoid loading numpy at startup. This is still doable but require a bit of work (see in #13386).
Vincent