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()
- Host: GitHub
- URL: https://github.com/writetome51/get-square-root
- Owner: writetome51
- License: other
- Created: 2019-04-11T19:52:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T03:33:05.000Z (almost 6 years ago)
- Last Synced: 2025-09-17T22:54:36.235Z (9 months ago)
- Topics: javascript, square-root
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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';
```