Opened 3 years ago

#21556 new defect

QQbar.radical_expression should raise exception if it fails

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

Description

Presently:

sage: a=QQbar(2^(1/5))
sage: (a+a^2).radical_expression()
2.468206265769930?

indicates that the routine was unable to find a radical expression (although one does exist. That has its own ticket #17516).

It would be much clearer if failure was signaled with raising an exception like ValueError("Cannot determine radical expression for number"). Getting back a value that is not a radical expression when you've just asked for it is likely not that useful. Catching the relevant exception is probably a better way of dealing with the issue.

Change History (0)

Note: See TracTickets for help on using tickets.