# math-hacker

> Library to hack native Math

Latest version **0.0.1** (published 2015-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install math-hacker
pnpm add math-hacker
yarn add math-hacker
bun add math-hacker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-10-09 |
| First published | 2015-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zoubin |
| Maintainers | zoubin |
| Keywords | math |

## Links

- npm: https://www.npmjs.com/package/math-hacker
- Repository: https://github.com/zoubin/math-hacker
- Homepage: https://github.com/zoubin/math-hacker#readme
- Issues: https://github.com/zoubin/math-hacker/issues
- npm.io page: https://npm.io/package/math-hacker

## 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

- 0.0.1 (latest) — 2015-10-09

## README

# math-hacker
Library to hack native Math

[![npm](https://nodei.co/npm/math-hacker.png?downloads=true)](https://www.npmjs.org/package/math-hacker)

[![version](https://img.shields.io/npm/v/math-hacker.svg)](https://www.npmjs.org/package/math-hacker)
[![status](https://travis-ci.org/zoubin/math-hacker.svg?branch=master)](https://travis-ci.org/zoubin/math-hacker)
[![devDependencies](https://david-dm.org/zoubin/math-hacker/dev-status.svg)](https://david-dm.org/zoubin/math-hacker#info=devDependencies)

# API

```javascript
var math = require('math-hacker')

```

## math.precision(num)

```javascript
math.precision(0) // 0
math.precision(0.1) // 1

```

## math.add(a, b)

```javascript
math.add(1, 2)
// 3

math.add(0.34, 0.01)
// 0.35
// In chrome 45.0.2454.99, 0.34 + 0.01 will output 0.35000000000000003

math.add(1.1111, -1.11)
// 0.0011
// In chrome 45.0.2454.99, 1.1111 - 1.11 will output 0.0010999999999998789

```

## math.toFixed(num, precision)

```javascript
math.toFixed(2.385, 2)
// "2.39"
// In chrome 45.0.2454.99, (2.385).toFixed(2) will output "2.38"

math.toFixed(2.384, 2)
// "2.38"

math.toFixed(2, 2)
// "2.00"

```

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