Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/claudiopro/sqr
Calculates the square of numbers, and checks if they're square numbers
https://github.com/claudiopro/sqr
Last synced: 3 days ago
JSON representation
Calculates the square of numbers, and checks if they're square numbers
- Host: GitHub
- URL: https://github.com/claudiopro/sqr
- Owner: claudiopro
- License: bsd-3-clause
- Created: 2015-12-19T15:06:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-27T19:45:51.000Z (about 9 years ago)
- Last Synced: 2024-12-13T05:38:10.159Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/claudiopro/sqr.svg?branch=master)](https://travis-ci.org/claudiopro/sqr)
# sqr
Peasy easy math square function. Returns the product of a number multiplied by itself.
# API
`var sqr = require('sqr');`
## sqr(x)
Returns the square of number `x`.
## sqr.isSquare(x)
Returns true if `x` is a square number, i.e. an integer which can be obtained by squaring another integer, false otherwise.
## sqr.nearest(x)
Returns the nearest integer to `x` which is a square number.
# License
[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause)
Copyright (c) Claudio Procida 2015