https://github.com/loresoft/calculator
Calculator.NET - Calculator that evaluates math expressions
https://github.com/loresoft/calculator
Last synced: about 1 month ago
JSON representation
Calculator.NET - Calculator that evaluates math expressions
- Host: GitHub
- URL: https://github.com/loresoft/calculator
- Owner: loresoft
- License: apache-2.0
- Created: 2014-03-23T16:05:39.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-07-08T20:04:46.000Z (almost 10 years ago)
- Last Synced: 2026-01-14T00:57:34.980Z (3 months ago)
- Language: C#
- Size: 3.31 MB
- Stars: 100
- Watchers: 6
- Forks: 50
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Calculator.NET
==========
Calculator.NET - Calculator that evaluates math expressions
[](https://ci.appveyor.com/project/LoreSoft/calculator)
[](https://github.com/loresoft/Calculator/releases)
[](https://github.com/loresoft/Calculator/releases)
The library supports math expressions, functions unit conversion and variables. Below are some examples of using the library directly.
MathEvaluator eval = new MathEvaluator();
//basic math
double result = eval.Evaluate("(2 + 1) * (1 + 2)");
//calling a function
result = eval.Evaluate("sqrt(4)");
//evaluate trigonometric
result = eval.Evaluate("cos(pi * 45 / 180.0)");
//convert inches to feet
result = eval.Evaluate("12 [in->ft]");
//use variable
result = eval.Evaluate("answer * 10");
//add variable
eval.Variables.Add("x", 10);
result = eval.Evaluate("x * 10");
Calculator that evaluates math expressions.

### Calculator.NET Features
* Evaluate math expressions including grouping
* Support trigonometry and other function
* Common unit conversion of the following types
* Length
* Mass
* Speed
* Temperature
* Time
* Volume
* Variable support including last answer