0.0.13 • Published 10 years ago

mathfunctions v0.0.13

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

mathFunctions

Basic mathematical functions or methods.

browser support

examples

Function

var mathFn = require('./mathFunctions.js')();

mathFn.add(2, 3); // result: 5
mathFn.minus(2, 3); // result: -1

Method

var mathNumMethods = require('./mathFunctions.js')("numberMethods");
// returns an object with the numberMethods in

var nr = Object.create(mathNumMethods);
// Attach the methods to nr as prototypes

nr.value = 6;	// value: 6		returned this
nr.add(4);		// value: 10	returned this
nr.square();	// value: 100	returned this
nr.sqrt();		// value: 10	returned this
nr.minus(4);	// value: 6		returned this

// The same but chained:
var result = nr.add(4).square().sqrt().minus(4).value;
				// result: 6

License

MIT Copyright (c) 2014 Rune Taj Clemens Petersen

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago