Opened 8 years ago

Last modified 4 years ago

#14069 new defect

algebraic number < +Infinity return False

Reported by: slabbe Owned by: davidloeffler
Priority: major Milestone: sage-6.4
Component: number fields Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This bug was reported to me by Xavier Provençal:

sage: M3 = matrix(3,[-1,1,0,-1,0,1,1,0,0])
sage: a = M3.eigenvalues()[0]
sage: a            
0.5436890126920763?
sage: a < oo            # <---- this should return True
False
sage: a > -oo      
True               
sage: float(a) < oo
True               

Change History (10)

comment:1 Changed 8 years ago by slabbe

  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 follow-up: Changed 7 years ago by pbruin

This happens because QQbar does not coerce into InfinityRing (which is probably correct), and the coercion model does not discover UnsignedInfinityRing as a common parent. (Note that a < unsigned_infinity does work correctly.)

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:7 in reply to: ↑ 5 Changed 6 years ago by mmezzarobba

Replying to pbruin:

This happens because QQbar does not coerce into InfinityRing (which is probably correct), and the coercion model does not discover UnsignedInfinityRing as a common parent. (Note that a < unsigned_infinity does work correctly.)

In fact it could be argued that the result is correct, since QQbar is not ordered, and AA(a) < infinity works. I'm tempted to suggest closing the ticket as wontfix.

comment:8 follow-up: Changed 5 years ago by jakobkroeker

with recent sage we get

sage:  a <  oo
True
sage:  a < -oo
True
sage: -a <  oo
True
sage: -a < -oo
True

is that consistant/correct?

comment:9 in reply to: ↑ 8 Changed 5 years ago by pbruin

Replying to jakobkroeker:

with recent sage we get

sage:  a <  oo
True
sage:  a < -oo
True
sage: -a <  oo
True
sage: -a < -oo
True

is that consistant/correct?

The second and third answers are "obviously" false at first sight, but there is probably no "good" way to compare with signed infinity in QQbar. I think this should either be closed as wontfix (as in comment:7) or that UnsignedInfinityRing should be discovered as a common parent.

comment:10 Changed 4 years ago by jakobkroeker

The second and third answers are "obviously" false at first sight, but there is probably no >"good" way to compare with signed infinity in QQbar.

If there is no good way to compare with signed infinity in QQbar it should be incomparable?(IMHO)

Note: See TracTickets for help on using tickets.