-
-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #21105: abs for number field element
For a number field element `a`, `abs(a)` currently returns a floating point real number {{{ sage: K.<cbrt2> = NumberField(x^3 - 2, 'a', embedding=1.26) sage: abs(cbrt2) 1.25992104989487 sage: parent(_) Real Field with 53 bits of precision }}} If a coercion embedding is defined with value in `RR`, the absolute value can be defined internally as it is the case for `AA` {{{ sage: abs(AA(2).sqrt() - AA(2)) 0.5857864376269049? }}} and also for quadratic extensions {{{ sage: K.<sqrt2> = NumberField(x^2 - 2, 'a', embedding=1.41) sage: abs(sqrt2) sqrt2 }}} We propose to change the behavior for embedded number fields. Namely make `abs` an internal operation. As a (minor) consequence of the current behavior, the inequalities from `sage.geometry.polyhedron.representation.Inequality` gets badly displayed {{{ sage: K.<cbrt2> = NumberField(x^3 - 2, 'a', embedding=1.26) sage: P = Polyhedron(vertices=[(1,1,cbrt2),(cbrt2,1,1)]) sage: P.inequalities() (An inequality (-cbrt2^2 - cbrt2 - 1, 0, 0) x + 4.84732210186307 >= 0, An inequality (cbrt2^2 + cbrt2 + 1, 0, 0) x - 3.84732210186307 >= 0) }}} URL: https://trac.sagemath.org/21105 Reported by: vdelecroix Ticket author(s): Matthias Koeppe Reviewer(s): Vincent Delecroix
- Loading branch information
Showing
2 changed files
with
85 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters