Last updated
Was this helpful?
Last updated
Was this helpful?
This static class contains methods and properties to expose common operations to work with decimal
types.
All members bellow returns the corresponding functions as delegates.
WARNING
All operations classes related to numerical values (
int
,decimal
edouble
) contains the same properties and methods.
The properties returns a delegate, so, it's possible to use it as a method.
Add
Subtract
Multiply
Divide
For methods you can use a little different sintax. It's necessary because these methods uses the property methods combined with Partial Application.
Because of that, you need to execute the method with the first parameter to creates a new single parameter function that perform the operation.
AddWith
You can also use it as a chainable operation:
The ~With operations are available to the four main operations, all of them follows the same caracteristics that the previous example.
You can use these methods as Partial Applications if you needs to.
Add3With
You can also use it as a chainable operation:
You can use the two parameters overload as well:
Name
Type
Description
Add
Func<decimal, decimal, decimal>
Function to represents addition operation (+) between two values.
Subtract
Func<decimal, decimal, decimal>
Function to represents subtraction operation (-) between two values.
Multiply
Func<decimal, decimal, decimal>
Function to represents multiplication operation (*) between two values.
Divide
Func<decimal, decimal, decimal>
Function to represents division operation (/) between two values.
Add3
Func<decimal, decimal, decimal, decimal>
Function to represents addition operation (+) between three values.
Subtract3
Func<decimal, decimal, decimal, decimal>
Function to represents subtraction operation (-) between three values.
Multiply3
Func<decimal, decimal, decimal, decimal>
Function to represents multiplication operation (*) between three values.
Divide3
Func<decimal, decimal, decimal, decimal>
Function to represents division operation (/) between three values.
Name
Parameters
Returns
Description
AddWith
decimal value
Func<decimal, decimal>
Function to represents addition operation (+) between two values, applying first value as partial application on Add method.
SubtractWith
decimal value
Func<decimal, decimal>
Function to represents subtraction operation (-) between two values, applying first value as partial application on Subtract method.
MultiplyWith
decimal value
Func<decimal, decimal>
Function to represents multiplication operation (*) between two values, applying first value as partial application on Multiply method.
DivideWith
decimal value
Func<decimal, decimal>
Function to represents multiplication operation (/) between two values, applying first value as partial application on Divide method.
Add3With
decimal value
Func<decimal, decimal, decimal>
Function to represents addition operation (+) between three values, applying first value as partial application on Add3 method.
Add3With
decimal value
decimal value2
Func<decimal, decimal>
Function to represents addition operation (+) between three values, applying first and second values as partial application on Add3 method.
Subtract3With
decimal value
Func<decimal, decimal, decimal>
Function to represents subtraction operation (-) between three values, applying first value as partial application on Subtract3 method.
Subtract3With
decimal value
decimal value2
Func<decimal, decimal>
Function to represents subtraction operation (-) between three values, applying first and second values as partial application on Subtract3 method.
Multiply3With
decimal value
Func<decimal, decimal, decimal>
Function to represents multiplication operation (*) between three values, applying first value as partial application on Multiply3 method.
Multiply3With
decimal value
decimal value2
Func<decimal, decimal>
Function to represents multiplication operation (*) between three values, applying first and second values as partial application on Multiply3 method.
Divide3With
decimal value
Func<decimal, decimal, decimal>
Function to represents division operation (/) between three values, applying first value as partial application on Divide3 method.
Divide3With
decimal value
decimal value2
Func<decimal, decimal>
Function to represents division operation (/) between three values, applying first and second values as partial application on Divide3 method.