# stringy_numbers

> "Math operations on very large floating point numbers using strings"

Latest version **1.0.1** (published 2018-06-11) · ISC license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2018-06-11 |
| First published | 2018-05-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | aminkhandesign |
| Maintainers | aminkhandesign |
| Keywords | big, numbers, big, floating, point, division, addition, string, numbers |

## Links

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

## 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.1 (latest) — 2018-06-11
- 1.0.0 — 2018-05-28

## README

# Stringy Numbers

see [stringy_numbers repo](https://github.com/aminkhandesign/stringy_numbers) on github


## Introduction

Stringy Numbers is a lightweight javascript library that allows basic maths operations on very large numbers.

It works by using strings to bypass javascripts limitation on number sizes.
Numbers are input into functions as strings, ie. you have to enclose them in quotes as you would a string.
The operations support floating point.

## Installation

from terminal,
```
npm i stringy_numbers

```
to import..

```
const {mult,div,add,minus,squared,cubed} = require('path/to/node_modules/stringy_numbers')

```

## Functions

As of version 1.0.1 there are four basic maths operations available: 

-**mult()**  - _multiplication_,
-**div()**   - _division_,
-**add()**   - _addition_,
-**minus()** - _subtraction_

And now sqaured and cubed functions added:

-**squared()** - _find the square of a number_
-**cubed()** - _find the cube of a number_

  **mult()** takes two string numbers as arguments, multiplies them together 
            and returns the result as a string

 __e.g__
```
mult("1234","5678");
'7006652' 
``` 


  **div()** takes a number as its first argument, this sets the precision number 
          of significant digits  for the answer, the next two arguments are the 
          dividend and divisor in that order, entered as strings.
__e.g__

```
div(10,"1234","5678");
' .2173300457907' 
``` 

_Note: the leading zero is  omitted in answers that are less than one._
_however answers can be input with leading or trailing 0s._



  **add()** takes two string numbers as arguments, adds them together and
           returns the result as a string 
 __e.g__
```
add("1234","5678");
'6912' 
``` 


   **minus()** takes two string numbers as arguments, substracts the second 
   ``         from the first and returns teh result as a string.
 __e.g__
```
minus("1234","5678");
'-4444' 
``` 




There is also a __test()__ function that will run two given numbers through each of 
the maths operations and compare them with the output of javascripts equivalent 
native operation, e.g.

`test(404,3)`

logs the following to the console..

```
-----------------------------------------------
|              BIG FLOAT TEST                  |
-----------------------------------------------
MY MULT:   1212
NATIVE JS: 1212
-----------------------------------------------
MY ADD:    407
NATIVE JS: 407
-----------------------------------------------
MY MINUS:    401
NATIVE JS: 401
-----------------------------------------------
MY DIV:    134.66666666666666666
NATIVE JS: 134.66666666666666 

```


**Additional Notes**

 Negative numbers are supported simply by appending the string number with
 a '**-**' sign. Leading and Trailing zeros are permitted in entered numbers.

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