Eval.net
2.0.4
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Eval.net --version 2.0.4
NuGet\Install-Package Eval.net -Version 2.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Eval.net" Version="2.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eval.net" Version="2.0.4" />
<PackageReference Include="Eval.net" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Eval.net --version 2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Eval.net, 2.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Eval.net@2.0.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Eval.net&version=2.0.4
#tool nuget:?package=Eval.net&version=2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Eval.net
Easily evaluate simple expressions on the go...
This is a port of the BigEval.js library
Features:
- Evaluate basic math operators (
5 * (4 / 3)) - Use constants (
x * 27 / 4) - Support for pre-defined function calls (
30 * pow(24, 6) / cos(20)) - Support for custom function calls
- Support for logic operators (
26 * 3 < 100- returns aboolvalue) - Support for bitwise operators (
(1 << 2) == 4) - Support for string values (
"test" + 5 == "test5") - Customize the type that is used for numeric values in the expression.
- Customize the code behind the execution of any of the operators.
- Support for compiling an expression and running multiple times while supplying different constants
Nuget
Install-Package Eval.net
Usage
using Eval.net;
var result1 = (double)Evaluator.Execute("12+45*10", EvalConfiguration.DoubleConfiguration);
var result2 = (double)Evaluator.Execute("30 * pow(24, 6) / cos(20)", EvalConfiguration.DoubleConfiguration);
var compiled = Evaluator.Compile("5 * n", EvalConfiguration.DoubleConfiguration.Clone());
compiled.SetConstant("n", 8);
var result3 = (double)compiled.Execute();
compiled.SetConstant("n", 9);
var result4 = (double)compiled.Execute();
Operators
The operators currently supported in order of precedence are -
[
['!'], // Factorial
['**'], // power
['/', '*', '%'],
['+', '-'],
['<<', '>>'], // bit shifts
['<', '<=', '>', '>='],
['==', '=', '!='], // equality comparisons
['&'], ['^'], ['|'], // bitwise operations
['&&'], ['||'] // logical operations
]
Me
- Hi! I am Daniel Cohen Gindi. Or in short- Daniel.
- danielgindi@gmail.com is my email address.
- That's all you need to know.
Help
If you want to buy me a beer, you are very welcome to
Thanks 😃
License
This library is under the Apache License 2.0.
This library is free and can be used in commercial applications without royalty.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.6 | 1,060 | 7/26/2026 |
| 2.0.5 | 4,184 | 8/25/2025 |
| 2.0.4 | 397 | 8/25/2025 |
| 2.0.3 | 933 | 6/13/2025 |
| 2.0.2 | 385 | 6/13/2025 |
| 2.0.1 | 400 | 6/13/2025 |
| 2.0.0 | 827 | 1/19/2025 |
| 1.0.20 | 688 | 8/28/2023 |
| 1.0.19 | 554 | 6/29/2023 |
| 1.0.18 | 300 | 6/25/2023 |
| 1.0.17 | 468 | 1/17/2023 |
| 1.0.16 | 463 | 1/15/2023 |
| 1.0.15 | 443 | 12/27/2022 |
| 1.0.14 | 602 | 8/22/2022 |
| 1.0.13 | 605 | 7/19/2022 |
| 1.0.12 | 745 | 3/29/2022 |
| 1.0.10 | 751 | 12/2/2020 |