Opened 10 years ago

Last modified 6 years ago

## #14069 new defect

# algebraic number < +Infinity return False

Reported by: | Sébastien Labbé | Owned by: | David Loeffler |
---|---|---|---|

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: |

### 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 10 years ago by

Type: | PLEASE CHANGE → defect |
---|

### comment:2 Changed 9 years ago by

Milestone: | sage-5.11 → sage-5.12 |
---|

### comment:3 Changed 9 years ago by

Milestone: | sage-6.1 → sage-6.2 |
---|

### comment:4 Changed 8 years ago by

Milestone: | sage-6.2 → sage-6.3 |
---|

### comment:5 follow-up: 7 Changed 8 years ago by

### comment:6 Changed 8 years ago by

Milestone: | sage-6.3 → sage-6.4 |
---|

### comment:7 Changed 7 years ago by

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: 9 Changed 6 years ago by

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 Changed 6 years ago by

Replying to jakobkroeker:

with recent sage we get

sage: a < oo True sage: a < -oo True sage: -a < oo True sage: -a < -oo Trueis 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 6 years ago by

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.

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.)