mathtools.sign — Abjad v1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »

# mathtools.sign

`abjad.tools.mathtools.` `sign`(n)

  Return `-1`, `0`, `1` for negative, zero, positive numbers, respectively.

      abjad> mathtools.sign(-96.2)
      -1

      abjad> mathtools.sign(0)
      0

      abjad> mathtools.sign(Rational(9, 8))
      1

  Note

  `mathtools.sign(n)` aliases built-in `cmp(n, 0)`.

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »