# signum

> Returns the sign of a number

Latest version **1.0.0** (published 2014-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install signum
pnpm add signum
yarn add signum
bun add signum
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-04-30 |
| First published | 2014-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | sign, number, signum, plus, minus, zero |

## Links

- npm: https://www.npmjs.com/package/signum
- Repository: https://github.com/mikolalysenko/signum
- Issues: https://github.com/mikolalysenko/signum/issues
- npm.io page: https://npm.io/package/signum

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-04-30
- 0.0.0 — 2014-03-30

## README

signum
======
Returns the sign of a floating point number

# Example

```javascript
var sgn = require("signum")

console.log(sgn(-0.00001))
console.log(sng(0))
console.log(sng(Infinity))
```

Output:

```javascript
-1
0
1
```

# Install

```
npm install signum
```

# API

### `require("signum")(x)`
Returns the sign of `x`

* `x` is a number

**Returns** One of the following values

* `-1` if `x<0`
* `1` if `x>0`
* `0` otherwise

# Credits
(c) 2014 Mikola Lysenko. MIT License

---
_Source: https://npm.io/package/signum · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
