# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1274994734 3600
# Node ID ddd2fef62515d69f9e0ae56bd252fbd7c181310c
# Parent 3ba8c82fd4fb8fb98027bfa6858328289890f5c9
#9068  remove redundant sgn() function from quadratic_forms/extras.py
diff r 3ba8c82fd4fb r ddd2fef62515 sage/quadratic_forms/extras.py
a

b


8  8  from sage.rings.infinity import infinity 
9  9  from sage.misc.functional import squarefree_part 
10  10  
11   def sgn(x): 
12   """ 
13   Returns the sign of x. defined as: 
14   
15   / 1 if x > 0, 
16   sgn(x) =  0 if x = 0, 
17   \ 1 if x < 0. 
18   
19   INPUT: 
20   a real number 
21   
22   OUTPUT: 
23   1, 0, or 1. 
24   
25   EXAMPLES: 
26   
27   sage: from sage.quadratic_forms.extras import sgn 
28   sage: sgn(pi) == 1 
29   True 
30   sage: sgn(5/6) == 1 
31   True 
32   sage: sgn(0) == 0 
33   True 
34   sage: sgn(3) == 1 
35   True 
36   """ 
37   return ZZ(cmp(x,0)) 
38   
39  11  def is_triangular_number(n): 
40  12  """ 
41  13  Determines if the integer n is a triangular number. 
diff r 3ba8c82fd4fb r ddd2fef62515 sage/quadratic_forms/quadratic_form__local_field_invariants.py
a

b


28  28  from sage.rings.rational_field import QQ 
29  29  from sage.rings.real_mpfr import RR 
30  30  from sage.rings.arith import prime_divisors, valuation, hilbert_symbol 
31   from sage.quadratic_forms.extras import sgn 
 31  from sage.functions.all import sgn 
32  32  from sage.rings.fraction_field import FractionField 
33  33  from sage.matrix.matrix_space import MatrixSpace 
34  34  from sage.rings.arith import GCD 
diff r 3ba8c82fd4fb r ddd2fef62515 sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py
a

b


17  17  from sage.rings.finite_rings.integer_mod_ring import IntegerModRing 
18  18  from sage.rings.rational_field import QQ 
19  19  from sage.rings.arith import legendre_symbol, kronecker, prime_divisors 
20   from sage.quadratic_forms.extras import sgn 
 20  from sage.functions.all import sgn 
21  21  from sage.quadratic_forms.special_values import gamma__exact, zeta__exact, quadratic_L_function__exact 
22  22  from sage.misc.functional import squarefree_part 
23  23  from sage.symbolic.constants import pi 