magic.lambda.math 14.5.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package magic.lambda.math --version 14.5.7
                    
NuGet\Install-Package magic.lambda.math -Version 14.5.7
                    
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="magic.lambda.math" Version="14.5.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="magic.lambda.math" Version="14.5.7" />
                    
Directory.Packages.props
<PackageReference Include="magic.lambda.math" />
                    
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 magic.lambda.math --version 14.5.7
                    
#r "nuget: magic.lambda.math, 14.5.7"
                    
#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 magic.lambda.math@14.5.7
                    
#: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=magic.lambda.math&version=14.5.7
                    
Install as a Cake Addin
#tool nuget:?package=magic.lambda.math&version=14.5.7
                    
Install as a Cake Tool

Math slots in Hyperlambda

This project provides math functions to Magic. More specifically, it provides the following slots.

  • [math.multiply] - Multiplication
  • [math.divide] - Division
  • [math.add] - Addition
  • [math.subtract] - Subtraction
  • [math.modulo] - Modulo
  • [math.decrement] - Decrements a node's value, optionally by [step], defaulting to 1
  • [math.increment] - Increments a node's value, optionally by [step], defaulting to 1

All of the above besides the two last slots can be given any number of arguments, including as its value, and will treat the first argument as the "base", and performing the rest of the arguments self assigning the base as it proceeds. For instance, the following code will first divide 100 by 4, then divide that result by 5 again, resulting in 5.

math.divide:int:100
   :int:4
   :int:5

The value of the above [math.divide] node after evaluating the above Hyperlambda will be 5. All of the above slots will also evaluate the children collection as a lambda, before starting the actual math function, allowing you to recursively raise signals to retrieve values that are supposed to be mathematically handled somehow. This allows you to recursively nest math operations, such as for instance.

.one:int:5
.two:int:2

math.multiply
   .:int:3
   math.add
      get-value:x:@.one
      get-value:x:@.two

The above of course will first add 5 and 2, then multiple the result of that with 3, resulting in 21.

Incrementing and decrementing values

The above [math.increment] and [math.decrement] slots, will instead of yielding a result, inline modify the value of the node(s) it is pointing to, assuming its value is an expression. In addition these two slots can take an optional "step" argument, allowing you to declare how much the incrementation/decrementation process should add/reduce the original node's value by. Below is an example that decrements the value found in its expression by 2.

.value:int:5

math.decrement:x:-
   .:int:2

After executing the above, the result of [.value] will be 3. The default "step" value if ommitted will be 1. Below is an example.

.value:int:5

math.increment:x:-

Notice - You can use any slot invocation to retrieve the step value for the increment/decrement slots, including for instance an invocation to [get-value], or your custom slots. This is dues to that the first argument supplied to these slots will be assumed to be the "step" value you want.

Modulo

The modulo slot divides its argument(s) by its base, and returns the remainder.

.int:17

math.modulo:x:-
   .:int:10

The above results in 7.

Project website

The source code for this repository can be found at github.com/polterguy/magic.lambda.math, and you can provide feedback, provide bug reports, etc at the same place.

Quality gates

  • Build status
  • Quality Gate Status
  • Bugs
  • Code Smells
  • Coverage
  • Duplicated Lines (%)
  • Lines of Code
  • Maintainability Rating
  • Reliability Rating
  • Security Rating
  • Technical Debt
  • Vulnerabilities
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 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on magic.lambda.math:

Package Downloads
magic.library

Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.2.0 1,771 1/22/2024
17.1.7 356 1/12/2024
17.1.6 337 1/11/2024
17.1.5 339 1/5/2024
17.0.1 382 1/1/2024
17.0.0 526 12/14/2023
16.11.5 467 11/12/2023
16.9.0 426 10/9/2023
16.7.0 723 7/11/2023
16.4.1 613 7/2/2023
16.4.0 601 6/22/2023
16.3.1 503 6/7/2023
16.3.0 513 5/28/2023
16.1.9 830 4/30/2023
15.10.11 663 4/13/2023
15.9.1 788 3/27/2023
15.9.0 624 3/24/2023
15.8.2 677 3/20/2023
15.7.0 576 3/6/2023
15.5.0 1,819 1/28/2023
15.2.0 843 1/18/2023
15.1.0 1,328 12/28/2022
14.5.7 855 12/13/2022
14.5.5 976 12/6/2022
14.5.1 804 11/23/2022
14.5.0 757 11/18/2022
14.4.5 872 10/22/2022
14.4.1 981 10/22/2022
14.4.0 796 10/17/2022
14.3.1 1,465 9/12/2022
14.3.0 833 9/10/2022
14.1.3 1,120 8/7/2022
14.1.2 825 8/7/2022
14.1.1 837 8/7/2022
14.0.14 909 7/26/2022
14.0.12 829 7/24/2022
14.0.11 875 7/23/2022
14.0.10 815 7/23/2022
14.0.9 854 7/23/2022
14.0.8 875 7/17/2022
14.0.5 978 7/11/2022
14.0.4 936 7/6/2022
14.0.3 883 7/2/2022
14.0.2 857 7/2/2022
14.0.0 1,084 6/25/2022
13.4.0 2,360 5/31/2022
13.3.4 1,668 5/9/2022
13.3.0 1,149 5/1/2022
13.2.0 1,401 4/21/2022
13.1.0 1,238 4/7/2022
13.0.0 921 4/5/2022
11.0.5 1,625 3/2/2022
11.0.4 997 2/22/2022
11.0.3 971 2/9/2022
11.0.2 996 2/6/2022
11.0.1 947 2/5/2022
10.0.21 977 1/28/2022
10.0.20 947 1/27/2022
10.0.19 925 1/23/2022
10.0.18 930 1/17/2022
10.0.15 1,176 12/31/2021
10.0.14 765 12/28/2021
10.0.7 1,713 12/22/2021
10.0.5 955 12/18/2021
9.9.9 1,899 11/29/2021
9.9.3 1,142 11/9/2021
9.9.2 830 11/4/2021
9.9.0 943 10/30/2021
9.8.9 915 10/29/2021
9.8.7 865 10/27/2021
9.8.6 836 10/27/2021
9.8.5 905 10/26/2021
9.8.0 1,585 10/20/2021
9.7.9 843 10/19/2021
9.7.8 820 10/19/2021
9.7.5 1,483 10/14/2021
9.7.0 1,062 10/9/2021
9.6.6 1,423 8/14/2021
9.2.0 6,863 5/26/2021
9.1.4 1,527 4/21/2021
9.1.0 1,283 4/14/2021
9.0.0 1,090 4/5/2021
8.9.9 1,199 3/30/2021
8.9.3 1,754 3/19/2021
8.9.2 1,222 1/29/2021
8.9.1 1,191 1/24/2021
8.9.0 1,322 1/22/2021
8.6.9 3,279 11/8/2020
8.6.6 2,199 11/2/2020
8.6.0 4,299 10/28/2020
8.5.0 2,182 10/23/2020
8.4.0 5,919 10/13/2020
8.3.1 2,941 10/5/2020
8.3.0 1,420 10/3/2020
8.2.2 2,249 9/26/2020
8.2.1 1,535 9/25/2020
8.2.0 1,594 9/25/2020
8.1.19 3,461 9/21/2020
8.1.18 1,486 9/15/2020
8.1.17 3,680 9/13/2020
8.1.16 795 9/13/2020
8.1.15 2,141 9/12/2020
8.1.11 2,805 9/11/2020
8.1.10 1,554 9/6/2020
8.1.9 1,538 9/3/2020
8.1.8 1,550 9/2/2020
8.1.7 1,402 8/28/2020
8.1.4 1,394 8/25/2020
8.1.3 1,515 8/18/2020
8.1.2 1,459 8/16/2020
8.1.1 1,519 8/15/2020
8.1.0 773 8/15/2020
8.0.1 2,980 8/7/2020
8.0.0 1,406 8/7/2020
7.0.1 1,582 6/28/2020
7.0.0 1,450 6/28/2020
5.0.0 7,841 2/25/2020
4.0.4 8,276 1/27/2020
4.0.3 1,471 1/27/2020
4.0.2 1,669 1/16/2020
4.0.1 1,628 1/11/2020
4.0.0 1,560 1/5/2020
3.1.0 6,676 11/10/2019
3.0.0 4,192 10/23/2019
2.0.1 8,748 10/15/2019
2.0.0 1,836 10/13/2019
1.1.8 1,598 10/11/2019
1.1.7 1,555 10/10/2019
1.1.6 791 10/9/2019
1.1.5 784 10/6/2019
1.1.4 787 10/6/2019
1.1.3 786 10/5/2019
1.1.2 804 10/5/2019
1.0.0 846 9/26/2019