https://github.com/tom-weatherhead/thaw-gcd
Euclid's greatest common divisor algorithm as a JavaScript component and npm package
https://github.com/tom-weatherhead/thaw-gcd
euclidean-algorithm gcd gcd-calculator math mathematics number-theory
Last synced: about 2 months ago
JSON representation
Euclid's greatest common divisor algorithm as a JavaScript component and npm package
- Host: GitHub
- URL: https://github.com/tom-weatherhead/thaw-gcd
- Owner: tom-weatherhead
- License: mit
- Created: 2017-08-22T12:38:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T05:03:10.000Z (about 7 years ago)
- Last Synced: 2025-09-14T16:53:16.697Z (2 months ago)
- Topics: euclidean-algorithm, gcd, gcd-calculator, math, mathematics, number-theory
- Language: JavaScript
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thaw-gcd
[](http://travis-ci.org/tom-weatherhead/thaw-gcd) [](https://www.npmjs.com/package/thaw-gcd)
Euclid's greatest common divisor algorithm as a JavaScript component and npm package.
See https://en.wikipedia.org/wiki/Euclidean_algorithm .
Git installation instructions:
$ git clone https://github.com/tom-weatherhead/thaw-gcd.git
$ cd thaw-gcd
$ npm install -g grunt
$ npm install
$ grunt
npm Installation Instructions:
$ npm install [--save] thaw-gcd
Sample usage of the npm package in a Node.js application:
$ git init thaw-gcd-client-app
$ cd thaw-gcd-client-app
$ npm init -y
$ npm install --save thaw-gcd
- Save the following three lines of code in the file index.js :
const gcd = require('thaw-gcd');
console.log('gcd is', gcd);
console.log('gcd(35, 84) ===', gcd(35, 84)); // The result should be 7
$ node index.js
For examples of client-side use of this package, see the "examples" directory.