NCalc101 - Examples

Explore these examples to learn how to use NCalc101 for a variety of calculations. Try them out in your workspace or use them as templates for your own work!

Basic Arithmetic

  • 7 + 512
  • 10 - 37
  • 4 * 624
  • 20 / 45
  • 2^532

Using Parentheses

  • (2 + 3) * 420
  • 8 / (1 + 1)4

Variables

  • a = 10
  • b = 5
  • a + b15
  • c = a * b50

Functions

  • sqrt(25)5
  • sin(3.1416 / 2)1
  • log(100)4.6052
  • max(3, 7, 2)7

Combining Features

  • x = 8
  • y = sqrt(x) + 24
  • z = (x + y) / 26

Error Handling

  • sqrt(-4)Error: Invalid input for sqrt
  • unknownVar + 2Error: Variable not defined

Tips

  • Use variables to simplify complex calculations.
  • Try built-in functions for advanced math.
  • Check the output for errors and variable values.

Experiment with these examples and create your own to get the most out of NCalc101!

Reconnection

Reconnection

Reconnection

timed out

timed out

Attempt of

Reload
An unhandled error has occurred. Reload 🗙