# Ticket #9068: trac_9068-sgn.patch

File trac_9068-sgn.patch, 2.6 KB (added by cremona, 12 years ago)

Applies to 4.4.3.alpha0

```# 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 from sage.rings.infinity import infinity from sage.misc.functional import squarefree_part def sgn(x): """ Returns the sign of x. defined as: /  1  if  x > 0, sgn(x) =   |  0  if  x = 0, \ -1  if  x < 0. INPUT: a real number OUTPUT: 1, 0, or -1. EXAMPLES: sage: from sage.quadratic_forms.extras import sgn sage: sgn(pi) == 1 True sage: sgn(5/6) == 1 True sage: sgn(0) == 0 True sage: sgn(-3) == -1 True """ return ZZ(cmp(x,0)) def is_triangular_number(n): """ Determines if the integer n is a triangular number.
`diff -r 3ba8c82fd4fb -r ddd2fef62515 sage/quadratic_forms/quadratic_form__local_field_invariants.py`
`diff -r 3ba8c82fd4fb -r ddd2fef62515 sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py`