News for hackers. Stuff that matters.
Re:On Primes and Pluto by hdevalence on Thursday March 06, 2014 @03:08PM (#7356236)
If you want to do exact computations, SAGE is handy, Free, and built on Python:

    sage: k.<a> = QuadraticField(7); k
    Number Field in a with defining polynomial x^2 - 7
    sage: x = 3*a - 8
    sage: x.is_integral()
    True
    sage: 1/x
    -3*a - 8
    sage: x * (1/x)
    1
    sage: (1/x).is_integral()
    True
(Note: the is_integral() is because we define k to be QQ(sqrt(7)), not ZZ(sqrt(7)), so we want to check that our elements are really integers, i.e., lie in ZZ(sqrt(7))).

There are no comments on this comment yet.