Dubacik22.Equationer 1.0.20

dotnet add package Dubacik22.Equationer --version 1.0.20                
NuGet\Install-Package Dubacik22.Equationer -Version 1.0.20                
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="Dubacik22.Equationer" Version="1.0.20" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dubacik22.Equationer --version 1.0.20                
#r "nuget: Dubacik22.Equationer, 1.0.20"                
#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.
// Install Dubacik22.Equationer as a Cake Addin
#addin nuget:?package=Dubacik22.Equationer&version=1.0.20

// Install Dubacik22.Equationer as a Cake Tool
#tool nuget:?package=Dubacik22.Equationer&version=1.0.20                

formula parsing library.

this library can parse string equations and recognize user functions and user variables like: func1(null, 1, var0, func2(var1, some.other.var2)+'str', -60) where va0, var1, some.other.var2 are recognized as variables func1, func2 are recognized as functions and 'str' is recognized as string constant. also -60 as double constant

returns ICalculatable which has GetCalculatedValue() to get the result

if there is a variable in the formula, then the parser gets it using the "FetchVariable" fetcher. this fetcher must return the IGetVariable class, which must have the property Variable of type object, but it is useful if it returns a double, bool or string. if there is a function in the formula, then the parser gets it using the "FetchFunction" fetcher. this fetcher must return an IFunction class which must have a double Calculate(IEnumerable<double> arguments)

when string "(4>5)==false" is parsed, and GetCalculatedValue() of resulting ICalculatable is called, we gets true as result. the GetCalculatedValue() of Calculatable calls Variable getter for each IGetVariable and Calculate method for each IFunction class and returns resulting object.

public class DummyValue : IGetVariable
{
    public object Variable { get => double.NaN; }
}
public class DummyFunc : IFunction
{
    public object Calculate(IEnumerable<object> arguments)
    {
        return arguments.First();
    }
}
public class Test()
{
    var parser = new EquationParser
    {
        FetchFunction = name => new DummyFunc(),
        FetchVariable = name => new DummyValue(),
    }
    parser.Parse("(v) ? 1 : (v > 1) ? 's' : f(v, 2)");
    parser.Parse("(4>5)==false");
    parser.Parse("(true) and ('qw' == 'ivan')");
    parser.Parse("(true) ? (4 gteq 4) ? 1 : 2 : 3");
    parser.Parse("func1(null, 1, #var0, func2(var1, some.other.var2)+'_a', -60)");
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  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.

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
1.0.20 106 5/13/2024
1.0.19 252 11/21/2023
1.0.18 138 11/21/2023
1.0.16 205 7/28/2023
1.0.15 173 7/18/2023
1.0.14 204 7/4/2023
1.0.13 214 6/28/2023
1.0.12 179 6/27/2023
1.0.11 189 6/27/2023
1.0.10 197 6/20/2023
1.0.9 198 6/19/2023
1.0.8 181 6/13/2023
1.0.7 169 6/5/2023
1.0.6 200 5/31/2023
1.0.5 468 9/17/2022
1.0.4 431 8/16/2022
1.0.3 485 3/4/2022
1.0.2 468 2/4/2022
1.0.1 5,252 11/24/2021