CSMic.StandardLibrary
2.1.1
dotnet add package CSMic.StandardLibrary --version 2.1.1
NuGet\Install-Package CSMic.StandardLibrary -Version 2.1.1
<PackageReference Include="CSMic.StandardLibrary" Version="2.1.1" />
<PackageVersion Include="CSMic.StandardLibrary" Version="2.1.1" />
<PackageReference Include="CSMic.StandardLibrary" />
paket add CSMic.StandardLibrary --version 2.1.1
#r "nuget: CSMic.StandardLibrary, 2.1.1"
#:package CSMic.StandardLibrary@2.1.1
#addin nuget:?package=CSMic.StandardLibrary&version=2.1.1
#tool nuget:?package=CSMic.StandardLibrary&version=2.1.1
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:
InitializeAllFunctionsInitializeConstantsInitializeBaseFunctionsInitializeAngleFunctionsInitializeRoundingFunctionsInitializeTrigonometryFunctionsInitializeNumberTheoryFunctionsInitializeRandomFunctions
Constants
InitializeConstants registers:
pietauphigoldenratioeurlereuleromega
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 | 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 | 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. |
-
.NETStandard 2.1
- CSMic (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.