Test additional content header

Number Class

Represents a numeric type enclosing native decimal value type, it supports arithmetic, comparison, and equality operators.

Definition

Namespace: Fluent.Calculations.Primitives.BaseTypes
Assembly: Fluent.Calculations.Primitives (in Fluent.Calculations.Primitives.dll) Version: 1.1.0-aplha
public class Number : Value, IAdditionOperators<Number, Number, Number>, 
	ISubtractionOperators<Number, Number, Number>, IMultiplyOperators<Number, Number, Number>, 
	IDivisionOperators<Number, Number, Number>, IComparisonOperators<Number, Number, Condition>, 
	IEqualityOperators<Number, Number, Condition>, IComparisonOperators<Number, Number, bool>, 
	IEqualityOperators<Number, Number, bool>
Inheritance
Object    Value    Number
Implements
IAdditionOperatorsNumber, Number, Number, IComparisonOperatorsNumber, Number, Condition, IComparisonOperatorsNumber, Number, Boolean, IDivisionOperatorsNumber, Number, Number, IEqualityOperatorsNumber, Number, Condition, IEqualityOperatorsNumber, Number, Boolean, IMultiplyOperatorsNumber, Number, Number, ISubtractionOperatorsNumber, Number, Number

Remarks

Additionally this class implements Generic Math operators.

Constructors

Number Initializes a new instance of the Number.
Number(MakeValueArgs) Initializes a new instance of the Number with provided values as arguments.
Number(Number) Initializes a new instance of the Number by making a deep copy of an existing value.

Properties

ExpressionMetadata of expression that yielded this value.
(Inherited from Value)
NameName of value
(Inherited from Value)
OriginOrigin type of the value.
(Inherited from Value)
PrimitiveNumeric primitive representation of the value.
(Inherited from Value)
PrimitiveStringFormatted string representation of the primitive value.
(Inherited from Value)
ScopeNamed scope that this value is part of
(Inherited from Value)
TagsCustom tags associated with the value.
(Inherited from Value)
TypeOriginal type of the value implementation.
(Inherited from Value)
Zero Returns an Number instance representing zero value.

Methods

AdditionAdds the specified Number value to this value.
DivisionDivides the this value by specified Number.
EqualityReturns a Condition that indicates whether this and specified value are different.
Equals(IValueProvider) Determines whether two Values are equal based on underlying primitive value.
(Inherited from Value)
Equals(Object)Determines whether two Numbers are equal based on underlying primitive value.
(Overrides ValueEquals(Object))
GetHashCodeServes as the default hash function, returns hash of the Primitive property value. This function is a subject to future change.
(Overrides ValueGetHashCode)
GreaterThanReturns a Condition that indicates whether this is greater than specified value.
GreaterThanOrEqualReturns a Condition that indicates whether this is greater than or equal to specified value.
HandleBinaryOperationResultType, ResultPrimitiveType Handles math and comparison operations of underlying primitve values in derived types.
(Inherited from Value)
InequalityReturns a Condition that indicates whether this and specified value are equal.
LessThanReturns a Condition that indicates whether this is less than specified value.
LessThanOrEqualReturns a Condition that indicates whether this is less than or equal to specified value.
MakeDefaultInitializes new Number representing zero decimal.
(Overrides ValueMakeDefault)
MakeOfThisTypeInitializes a new instance of Number class.
(Overrides ValueMakeOfThisType(MakeValueArgs))
MultiplyMultiplies the specified Number value with this value.
Of(Decimal, String) Creates a new named Number instance.
Of(Decimal, String, String) Creates a new named Number instance with named scope.
op_Equality 
op_GreaterThan 
op_GreaterThanOrEqual 
op_Inequality 
op_LessThan 
op_LessThanOrEqual 
SubtractionSubtracts the specified Number value from this value.
ToStringReturns a string that represents the current Number.
(Overrides ValueToString)

Operators

Addition(Number, Number)Adds two specified Number values.
Division(Number, Number)Divides two specified Number values.
Equality(Number, Number)Returns a value that indicates whether two Number values are equal.
GreaterThan(Number, Number)Returns a value indicating whether a specified Number is greater than another specified Number.
GreaterThanOrEqual(Number, Number)Returns a value indicating whether a specified Number is greater than or equal to another specified Number.
(Decimal to Number) Implicit converstion from decimal to Number.
(Int32 to Number) Implicit converstion from int to Number.
Inequality(Number, Number)Returns a value that indicates whether two Nummber objects have different values.
LessThan(Number, Number)Returns a value indicating whether a specified Number is less than another specified Number.
LessThanOrEqual(Number, Number)Returns a value indicating whether a specified Number is less than or equal to another specified Number.
Multiply(Number, Number)Multiplies two specified Number values.
Subtraction(Number, Number)Subtracts two values to compute their difference.

See Also