ncalc
Thriving Thriving C# C#
↑ 72 ?
ncalc Allied-Bits-Ltd/ncalc

NCalc is a fast and lightweight expression evaluator library for .NET, designed for flexibility and high performance. It supports a wide range of mathematical and logical operations. This version of NCalc has tons of features not present in the original library.

https://alliedbits.com/ncalc/ ↗
HEALTH ? 91 / Healthy
// solo builder// hidden gem// community hub ?

// readme

NCalc

NCalc is a fast and lightweight expression evaluator library for .NET, designed for flexibility and high performance. It supports a wide range of mathematical and logical operations. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions. NCalc targets .NET 10, .NET 9, .NET 8, .NET Standard 2.0, and NET Framework 4.6.2 and later.

Advanced features

This version of NCalc contains a number of advanced features compared to the original NCalc project, such as

  • Assignable parameters (variables) including shortcut operators (+=, etc.).
  • Statement sequences (useful together with parameter assignments) which, in expressions, may be grouped using curly brackets (like in C-like languages).
  • Support for indexed expressions (when an expression evaluates to a list a string, it is possible to access individual elements or a range of elements and assign new values to individual elements).
  • Support for loops using the ‘while’ loop statement (it follows the regular C-like style) with ‘break’ and ‘continue’ flow control keywords.
  • Support for the ‘if’ statement, which follows the regular C-like style.
  • Support for…