LogoDuyệtSr. Data Engineer
HomeAboutPhotosInsightsCV

Footer

Logo

Resources

  • Rust Tiếng Việt
  • /archives
  • /series
  • /tags
  • Status

me@duyet.net

  • About
  • LinkedIn
  • Resume
  • Projects

© 2026 duyet.net | Sr. Data Engineer

calc.js - evaluate expressions for Math

Note: This post is over 10 years old. The information may be outdated.

Flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices. Powerful and easy to use.

Install

npm install calc.js

Usage

var calc = require('calc.js')

calc('12 / (2.3 + 0.7)') // 4
calc('5.08 cm to inch') // 2 inch
calc('sin(45 deg) ^ 2') // 0.5
calc('9 / 3 + 2i') // 3 + 2i
calc('det([-1, 2; 3, 1])') // -7

Credit

Thanks to mathjs eval.

Source

  • calc.js | Github
  • calc.js | NPM
Mar 27, 2016·10 years ago
|Javascript|
Node.jsNpmJavascript
|Edit|

Related Posts

Yarn: A new package manager for JavaScript

Facebook has launched Yarn

Oct 13, 2016·9 years ago
Read more

copy.js - simple copy text to clipboard in the browser

Simple copy to clipboard. No Flash.

Feb 17, 2016·10 years ago
Read more

Resting và Spreading JavaScript Objects

Resting và spreading càng ngày được ưa chuộng vì sự tiện lợi của nó, sau đây là 7 tricks với JavaScript objects.

Mar 27, 2019·7 years ago
Read more

Javascript Weekly #9

Javascript Weekly #9: Date-DNS, chi tiết về các bản cập nhật mới của V8, React và Angular. ![](https://2.bp.blogspot.com/-3n1yGifwJdY/WEtxXVdp38I/AAAAAAAAgt4/ijum1QPHo6ENxNmPawMuGeKyxKfw2tfEACLcB/s1600/Screenshot%2Bfrom%2B2016-12-10%2B10-06-59.png) ## [date-fns: A Modern...

Dec 10, 2016·9 years ago
Read more
On this page
  • Install
  • Usage
  • Credit
  • Source
On this page
  • Install
  • Usage
  • Credit
  • Source