An open API service indexing awesome lists of open source software.

https://github.com/writetome51/get-square-root

Strict type-checking version of Math.sqrt()
https://github.com/writetome51/get-square-root

javascript square-root

Last synced: 9 months ago
JSON representation

Strict type-checking version of Math.sqrt()

Awesome Lists containing this project

README

          

# getSquareRoot(number): number

`number` must be finite number (and type 'number').

## Examples
```
getSquareRoot(4);
// --> 2

getSquareRoot(64);
// --> 8

getSquareRoot(10);
// --> 3.1622776601683795

getSquareRoot(Infinity);
// Error: 'Input must be a finite number'

getSquareRoot("64"); // input cannot be type 'string'
// Error: 'Input must be a finite number'
```

## Installation
`npm i @writetome51/get-square-root`

## Loading
```js
import { getSquareRoot } from '@writetome51/get-square-root';
```