Skip to content

writetome51/get-square-root

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

import { getSquareRoot } from '@writetome51/get-square-root';

About

Strict type-checking version of Math.sqrt()

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages