Skip to content

Math Expression Evaluator that combines Minimal Web API and a Math Expression Library.

License

Notifications You must be signed in to change notification settings

xgrois/ExpressionEvaluator

Repository files navigation

ExpressionEvaluator

A math web API to perform some calculations.

Example:

curl -X 'POST' \
  'https://localhost:7283/evaluate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "expression": "25*(3-2)^2"
}'

You can pass your math expression in the body

{
  "expression": "25*(3-2)^2"
}

and you will get the response

{
  "expression": "25*(3-2)^2",
  "result": 25
}

Using variables

You can set variables...

Example:

curl -X 'POST' \
  'https://localhost:7283/variables' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "x",
  "value": 5
}'

You can pass your math expression in the body

{
  "name": "x",
  "value": 5
}

and then use for evaluations,

curl -X 'POST' \
  'https://localhost:7283/evaluate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "expression": "x*2+1"
}'

You can pass your math expression in the body

{
  "expression": "x*2+1"
}

and you will get the response

{
  "expression": "x*2+1",
  "result": 11
}

About

Math Expression Evaluator that combines Minimal Web API and a Math Expression Library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages