# Changeset 7456:f60ec7365b2b

Ignore:
Timestamp:
12/01/07 10:48:42 (6 years ago)
Branch:
default
Parents:
7454:0cb746e1a4bd (diff), 7455:3eda63e6eb1a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge

Files:
2 edited

Unmodified
Removed
• ## sage/rings/arith.py

 r7453 def valuation(m, p): """ The exact power of p>0 that divides the integer m. We do not require that p be prime, and if m is 0, then this function returns rings.infinity. EXAMPLES:: The exact power of p that divides m. m should be an integer or rational (but maybe other types work too.) This actually just calls the m.valuation() method. If m is 0, this function returns rings.infinity. EXAMPLES: sage: valuation(512,2) 9 sage: valuation(1,2) 0 Valuation of 0 is defined, but valuation with respect to 0 is not:: sage: valuation(5/9, 3) -2 Valuation of 0 is defined, but valuation with respect to 0 is not: sage: valuation(0,7) +Infinity Traceback (most recent call last): ... ValueError: valuation at 0 not defined Here are some other example:: ValueError: You can only compute the valuation with respect to a integer larger than 1. Here are some other examples: sage: valuation(100,10) 2 1 """ if p <= 0: raise ValueError, "valuation at 0 not defined" if m == 0: import sage.rings.all return sage.rings.all.infinity r=0 power=p while m%power==0: r += 1 power *= p return r return m.valuation(p)
• ## sage/rings/arith.py

 r7455 r""" Returns True if $x$ is prime, and False otherwise.  The result is proven correct -- {\em this is NOT a pseudo-primality test!}. is proven correct -- \emph{this is NOT a pseudo-primality test!}. INPUT: r""" Returns True if $x$ is a pseudo-prime, and False otherwise.  The result is \em{NOT} proven correct -- {\em this is a pseudo-primality test!}. is \emph{NOT} proven correct -- \emph{this is a pseudo-primality test!}. INPUT: r""" Returns True if $x$ is a prime power, and False otherwise. The result is proven correct -- {\em this is NOT a The result is proven correct -- \emph{this is NOT a pseudo-primality test!}. The qsieve and ecm commands give access to highly optimized implementations of algorithms for doing certain integer factorization problems.  These implementation are not used by factorization problems.  These implementations are not used by the generic factor command, which currently just calls PARI (note that PARI also implements sieve and ecm algorithms, but [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1] sage: continued_fraction_list(sqrt(4/19)) [0, 2, 5, 1, 1, 2, 1, 16, 1, 2, 1, 1, 5, 4, 5, 1, 1, 2, 1, 18] [0, 2, 5, 1, 1, 2, 1, 16, 1, 2, 1, 1, 5, 4, 5, 1, 1, 2, 1, 15, 2] sage: continued_fraction_list(RR(pi), partial_convergents=True) ([3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3],
Note: See TracChangeset for help on using the changeset viewer.