#13213: Comparisons in real number field
-------------------------------------------------+--------------------------
Reporter: vdelecroix | Owner: vdelecroix
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.2
Component: number fields | Resolution:
Keywords: real number field, comparison | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Vincent Delecroix | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------------+--------------------------
Description changed by vdelecroix:
Old description:
> Provide the order from RR for number field embedded in RR as in
> {{{
> sage: K.<sqrt2> = NumberField(x^2 - 2, 'sqrt2', embedding=1.4142)
> sage: sqrt2 - 1 > 0
> True
> sage: sqrt2 < 2
> True
> }}}
>
> There is a patch for quadratic field. Another one is comming for general
> number fields.
New description:
Provide the order from RR for number field embedded in RR as in
{{{
sage: K.<sqrt2> = NumberField(x^2 - 2, 'sqrt2', embedding=1.4142)
sage: sqrt2 - 1 > 0
True
sage: sqrt2 < 2
True
}}}
There is a patch for quadratic field. Another one is comming for general
number fields.
Timings with the patch
{{{
sage: K.<sqrt2> = QuadraticField(2,'sqrt2',embedding=1.4142)
sage: b = (5*sqrt2 + 14)/5
sage: a = (3*sqrt2 + 18)/7
sage: %timeit a < b
625 loops, best of 3: 6.68 µs per loop
}}}
Timings without the patch
{{{
sage: sage: K.<sqrt2> = QuadraticField(2,'sqrt2',embedding=1.4142)
sage: a = (3*sqrt2 + 18)/7
sage: b = (5*sqrt2 + 14)/5
sage: %timeit a < b
625 loops, best of 3: 478 ns per loop
}}}
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13213#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.