CSMic.StandardLibrary 2.1.1

dotnet add package CSMic.StandardLibrary --version 2.1.1
                    
NuGet\Install-Package CSMic.StandardLibrary -Version 2.1.1
                    
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="CSMic.StandardLibrary" Version="2.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSMic.StandardLibrary" Version="2.1.1" />
                    
Directory.Packages.props
<PackageReference Include="CSMic.StandardLibrary" />
                    
Project file
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 CSMic.StandardLibrary --version 2.1.1
                    
#r "nuget: CSMic.StandardLibrary, 2.1.1"
                    
#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 CSMic.StandardLibrary@2.1.1
                    
#: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=CSMic.StandardLibrary&version=2.1.1
                    
Install as a Cake Addin
#tool nuget:?package=CSMic.StandardLibrary&version=2.1.1
                    
Install as a Cake Tool

CSMic.StandardLibrary

CSMic.StandardLibrary adds optional functions and constants to the core CS-MIC interpreter. It is intended for applications that want end-user convenience functions without having to implement and register each one manually.

This package references CSMic.

dotnet add package CSMic.StandardLibrary

Basic Usage

using CSMic;
using CSMic.StandardLibrary;

var interpreter = new InputInterpreter();
Initializer.InitializeAll(interpreter);

decimal result = interpreter.Interpret("max(10, abs(-12))");
// result == 12

Initializer.InitializeAll registers every standard function and constant. Use a narrower initializer when you only want part of the library:

  • InitializeAllFunctions
  • InitializeConstants
  • InitializeBaseFunctions
  • InitializeAngleFunctions
  • InitializeRoundingFunctions
  • InitializeTrigonometryFunctions
  • InitializeNumberTheoryFunctions
  • InitializeRandomFunctions

Constants

InitializeConstants registers:

  • pi
  • e
  • tau
  • phi
  • goldenratio
  • eurler
  • euler
  • omega

Constants are stored as interpreter variables, so they can be used in normal expressions:

interpreter.Interpret("2 * pi");
interpreter.Interpret("tau / pi");

Functions

Base functions:

  • abs(value)
  • sign(value)
  • min(left, right)
  • max(left, right)
  • sqrt(value)
  • pow(base, exponent)
  • log(value, base)
  • ln(value)
  • lerp(start, end, amount)
  • smoothstep(startEdge, endEdge, value)
  • map(value, oldMinimum, oldMaximum, newMinimum, newMaximum)
  • normalize(value, minimum, maximum)

Angle functions:

  • degrees(radians)
  • radians(degrees)
  • wrapangle(value, minimum, maximum)

Rounding functions:

  • floor(value)
  • ceiling(value)
  • truncate(value)
  • frac(value)
  • round(value, precision)
  • clamp(value, minimum, maximum)

Trigonometry functions:

  • sin(value)
  • cos(value)
  • tan(value)
  • asin(value)
  • acos(value)
  • atan(value)
  • atan2(y, x)

Hyperbolic trigonometry functions:

  • sinh(value)
  • cosh(value)
  • tanh(value)
  • asinh(value)
  • acosh(value)
  • atanh(value)

Number theory functions:

  • fac(value)
  • ncr(n, r)
  • npr(n, r)
  • gcd(left, right)
  • lcm(left, right)
  • fib(index)
  • iseven(value)
  • isodd(value)
  • isint(value)
  • isprime(value)

Random functions:

  • flip()
  • bern(probability)
  • rand()
  • rands(minimum, maximum)
  • randn()
  • randns(minimum, maximum)

Package Role

CSMic.StandardLibrary does not replace the core interpreter. It extends an InputInterpreter instance by registering ICodedFunction implementations and assigning constants. You can combine these functions with your own custom functions on the same interpreter.

Product 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.1

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.1.1 102 6/30/2026
2.1.0 96 6/28/2026
2.0.2 104 6/24/2026
2.0.1 104 6/24/2026
2.0.0 106 6/24/2026