Socket
Socket
Sign inDemoInstall

math.js

Package Overview
Dependencies
0
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    math.js

A simple math library written in Javascript.


Version published
Weekly downloads
350
decreased by-4.63%
Maintainers
1
Install size
232 kB
Created
Weekly downloads
 

Readme

Source

math.js npm David

A simple math library written in Javascript

Install

https://nodei.co/npm/math.js.png?downloads=true&downloadRank=true&stars=true

Use

// load the module
var math = require('math.js');

// ask for a number's ceil
math.ceil(13);

Arithmetic functions

// Get a number's ceil
math.ceil(13);    // returns 13
math.ceil(13.4);  // returns 14

// Get a number's ceil on the 2nd decimal digit
math.dCeil(14.14, 2);   // returns 14.14
math.dCeil(14.143, 2);  // returns 14.15

// Get a number's round on the 2nd decimal digit
math.dRound(14.14, 2);   // returns 14.14
math.dRound(14.143, 2);  // returns 14.14

// Get a number's floor on the 2nd decimal digit
math.dFloor(14.14, 2);   // returns 14.14
math.dFloor(14.143, 2);  // returns 14.14

// Get a number's trunc on the 2nd decimal digit
math.dTrunc(14.14, 2);   // returns 14.14
math.dTrunc(14.143, 2);  // returns 14.14

Test

To execute the library's tests, first install the project dependencies:

$ npm install

Then, run the tests

$ npm test

Keywords

FAQs

Last updated on 04 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc