updated the math.js library, improved formatting

This commit is contained in:
josdejong 2013-03-14 21:22:31 +01:00
parent 139c108782
commit b0a5829e09
6 changed files with 768 additions and 187 deletions

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>math.js - an extensive math library for JavaScript and Node.js</title>
<title>math.js | an extensive math library for JavaScript and Node.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="title" content="math.js">

View File

@ -73,7 +73,7 @@ pre code,
}
#example .keyword {
color: rgb(0,78,208);
color: #004ED0;
}
#example .string {
color: orange;

View File

@ -7,18 +7,19 @@ title: Home
Math.js is an extensive math library for JavaScript and Node.js.
It features real and complex numbers, units, matrices, a large set of
mathematical functions, and a flexible expression parser.
mathematical functions, and a flexible expression parser. Math.js is
powerful and easy to use.
# Features
- Supports real and complex numbers, units, strings, arrays\*, and
matrices\*.
- Supports numbers, complex numbers, units, strings, arrays\*, and matrices\*.
- Contains a large set of built-in functions and constants.
- Contains a flexible expression parser.
- Compatible with JavaScripts built-in Math library.
- No dependencies. Runs on any JavaScript engine.
- Easily extensible.
- Compatible with JavaScript's built-in Math library.
- Powerful and easy to use.
*\* Note: arrays and matrices are to be implemented.*

View File

@ -454,10 +454,7 @@ function CommandLineEditor (params) {
var res;
try {
res = parser.eval(expr);
if ((res instanceof Number) || (typeof res == 'number')) {
res = math.round(res, 9);
}
res = math.format(parser.eval(expr));
}
catch (err) {
res = err.toString();

File diff suppressed because it is too large Load Diff

22
js/lib/math.min.js vendored

File diff suppressed because one or more lines are too long