Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mathjs

Package Overview
Dependencies
Maintainers
1
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathjs - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # math.js changelog

## <not yet released>, version 0.1.0
- Reached full compatibility with Javascripts standard Math library.
- More functions implemented.
- Some bugfixes.
## 2013-02-16, version 0.0.2

@@ -7,0 +14,0 @@

7

package.json
{
"name": "mathjs",
"version": "0.0.2",
"description": "An extended math library. Includes a parser, real and complex values, units, matrices, strings, and a large set of functions and constants.",
"version": "0.1.0",
"description": "An extensive JavaScript math library. Includes an advanced expression parser. Supports real and complex values, units, and matrices. Contains a large set of functions and constants.",
"author": "Jos de Jong <wjosdejong@gmail.com>",

@@ -12,2 +12,3 @@ "contributors": [

],
"homepage": "http://mathjs.org",
"repository": {

@@ -40,3 +41,3 @@ "type": "git",

},
"main": "math.js",
"main": "./math.js",
"engines": {

@@ -43,0 +44,0 @@ "node": "*"

@@ -1,13 +0,17 @@

# math.js
https://github.com/josdejong/mathjs
![math.js](https://raw.github.com/josdejong/mathjs/master/img/mathjs.png)
Math.js is an extended Math library for Javascript.
It is a superset of the standard Math library.
Powerful and easy to use.
Math.js is an extensive JavaScript math library, compatible with JavaScripts
standard Math library.
Math.js supports real values, complex values, units, strings, and matrices.
It contains an extensive set of built-in functions,
and comes with a flexible expression parser.
Features:
- A flexible expression parser.
- Support for real and complex values, units, strings, arrays, and matrices.
- A large set of built-in functions and constants.
- Easily extensible with new functions and constants.
- Powerful and easy to use.
Website: http://mathjs.org
## Install

@@ -20,4 +24,4 @@

Alternatively, the library can be downloaded from github:
[math.js](https://raw.github.com/josdejong/mathjs/master/mathjs.js), or minified:
[math.min.js](https://raw.github.com/josdejong/mathjs/master/mathjs.min.js).
[math.js](https://raw.github.com/josdejong/mathjs/master/math.js), or minified:
[math.min.js](https://raw.github.com/josdejong/mathjs/master/math.min.js).

@@ -27,5 +31,6 @@

### Node
### Node.js
Math.js can be loaded via require:
Math.js can be loaded in node.js via require, and similarly in the browser
using [require.js](http://requirejs.org/).

@@ -36,11 +41,19 @@ var math = require('mathjs'),

console.log(math.sqrt(25)); // 5
// use methods and types available in the math object
var a = math.sin(math.pi / 4);
var b = math.pow(a, 2);
console.log('sin(pi / 4) ^ 2 = ' + math.round(b, 3)); // 'sin(pi / 4) ^ 2 = 0.5'
var c = new Complex(3, -4);
console.log(math.sqrt(c).toString()); // 2 - i
var d = math.sqrt(c);
console.log('sqrt(3 - 4i) = ' + d); // 'sqrt(3 - 4i) = 2 - i'
var u = new Unit(45, 'deg');
console.log(math.sin(math.pi / 4)); // 0.7071067811865475
console.log(math.sin(u)); // 0.7071067811865475
var e = math.sqrt(-4);
console.log('sqrt(-4) = ' + e); // 'sqrt(-4) = 2i'
var f = new Unit(60, 'deg');
var g = math.cos(f);
console.log('cos(60 deg) = ' + math.round(g, 3)); // 'cos(60 deg) = 0.5'
### Browser

@@ -50,3 +63,3 @@

<!DOCTYPE html>
<!DOCTYPE HTML>
<html>

@@ -57,14 +70,9 @@ <head>

<body>
<script>
var Complex = math.type.Complex;
var Unit = math.type.Unit;
<script type="text/javascript">
// the math object is available here
console.log(math.sqrt(25)); // 5
var a = math.sqrt(-4);
console.log('sqrt(-4) = ' + a); // 'sqrt(-4) = 2i'
var c = new Complex(3, -4);
console.log(math.sqrt(c).toString()); // 2 - i
var u = new Unit(45, 'deg');
console.log(math.sin(math.pi / 4)); // 0.7071067811865475
console.log(math.sin(u)); // 0.7071067811865475
// ...
</script>

@@ -75,2 +83,75 @@ </body>

## Parser
The expression parser is not yet implemented. Coming soon...
## API
The math.js library contains the following data types, methods and constants.
### Data types
- Number
- String
- math.type.Complex
- math.type.Unit
### Constants
- math.E, math.e
- math.I, math.i
- math.LN2
- math.LN10
- math.LOG2E
- math.LOG10E
- math.PI, math.pi
- math.SQRT1_2
- math.SQRT2
### Methods
#### Arithmetic
- math.abs(x)
- math.add(x, y)
- math.ceil(x)
- math.divide(x, y)
- math.exp(x)
- math.fix(x)
- math.floor(x)
- math.larger(x, y)
- math.log(x)
- math.multiply(x, y)
- math.pow(x, y)
- math.round(x [, n])
- math.smaller(x, y)
- math.subtract(x, y)
- math.sqrt(x)
- math.unaryminus(x)
#### Probability
- math.random()
#### Statistics
- math.max(a, b, c, ...)
- math.min(a, b, c, ...)
#### Trigonometry
- math.acos(x)
- math.asin(x)
- math.atan(x)
- math.atan2(y, x)
- math.cos(x)
- math.sin(x)
- math.tan(x)
#### Units
- math.in(x, unit)
## Build

@@ -82,5 +163,6 @@

To build the project, [jake](https://github.com/mde/jake) must be installed
globally. Next, install all dependencies using npm. Then build the project
using jake.
The project uses [jake](https://github.com/mde/jake) as build tool,
and must be installed globally.
After jake is installed, the project dependencies can be downloaded using npm.
Then the project can be build by executing jake in the projects root.

@@ -92,19 +174,20 @@ cd mathjs

When jake is executed, it will generate the library math.js and math.min.js
from the source files, and will test the library.
## License
Math.js is licensed under the Apache 2.0 license.
Copyright (C) 2013 Jos de Jong <wjosdejong@gmail.com>
Copyright (C) 2013 Jos de Jong <wjosdejong@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc