# correct-calc

> Correct calulation for javascipt

Latest version **1.0.0** (published 2023-03-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install correct-calc
pnpm add correct-calc
yarn add correct-calc
bun add correct-calc
```

## 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 | 2023-03-22 |
| First published | 2023-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 115.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ramandeep Singh |
| Maintainers | raman_987 |
| Keywords | correct-calc, correct-calulation, correct-add, correct-sub, correct-divide, correct-div, correct-multiply, correct-mul, correct-floor |

## Links

- npm: https://www.npmjs.com/package/correct-calc
- npm.io page: https://npm.io/package/correct-calc

## Dependencies (2)

- [move-on](https://npm.io/package/move-on.md) ^2.1.9
- [of-type](https://npm.io/package/of-type.md) ^3.0.4

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-03-22

## README

# Correct Cal
Correct Calculation

## Description
Correct Cal is a lightweight library that provides accurate math operations for addition, subtraction, multiplication, and division in JavaScript. 
By default, JavaScript has some issues with floating-point arithmetic, which can lead to small calculation errors. 
Correct Cal solves this problem by using the custom library, which provides accurate decimal arithmetic.



## Installation

You can install Correct Math via npm. Simply run the following command:

```bash
npm install correct-math
```

## Usage
To use Correct Math in your JavaScript project, simply require it at the top of your file:

```bash
const correctMath = require('correct-math'); //CommonJs
import correctMath from 'correct-math'; //ES Module
```

Once you have required the package, you can use it to perform your calculations. Here are a few examples:

```bash
// Addition
const result = correctMath.add(0.1, 0.2); // 0.3
const result2 = correctMath.add(0.1, 0.2,'0.3',0.4,'5'); // 6

// Subtraction
const result = correctMath.sub(0.3, 0.1); // 0.2
const result2 = correctMath.sub(0.5, 0.1,'0.2'); // 0.2

// Multiplication
const result = correctMath.mul(0.1, 0.2); // 0.02
const result2 = correctMath.mul(0.5, 0.1,'0.2'); // 0.01

// Division
const result = correctMath.div(0.3, 0.1); // 3
const result2 = correctMath.div(0.3, 0.1,'3'); // 1

```

## Contributing
If you find any issues with Correct Math or have suggestions for improvement, please feel free to open an issue or pull request on the GitHub repository.

## License
Correct Math is released under the ISC License.


###### Note: The author shall not be held responsible for any kind of code error or any issues related to monetary matters.

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