Struct Real
Structure defining a real number.
Implements
Namespace: BRIDGES.Arithmetic.Numbers
Assembly: BRIDGES.dll
Syntax
public struct Real : IDotProduct<Real, double>, INorm<Real>, IMetric<Real>, IGroupAction<Real, double>
Constructors
| Improve this Doc View SourceReal(Real)
Declaration
public Real(Real real)
Parameters
Type | Name | Description |
---|---|---|
Real | real | Real number to deep copy. |
Real(Double)
Initialises a new instance of the Real structure by defining its value.
Declaration
public Real(double number)
Parameters
Type | Name | Description |
---|---|---|
Double | number | Value of the real number. |
Properties
| Improve this Doc View SourceOne
Gets a new instance of the Real structure equal to one : 1.0
..
Declaration
public static readonly Real One { get; }
Property Value
Type | Description |
---|---|
Real | The new Real number equal to one. |
Value
Value of the real numbers.
Declaration
public double Value { get; set; }
Property Value
Type | Description |
---|---|
Double |
Zero
Gets a new instance of the Real structure equal to zero : 0.0
.
Declaration
public static readonly Real Zero { get; }
Property Value
Type | Description |
---|---|
Real |
Methods
| Improve this Doc View SourceAdd(Real, Real)
Computes the addition of two Real numbers.
Declaration
public static Real Add(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number for the addition. |
Real | right | Right Real number for the addition. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the addition. |
DistanceTo(Real)
Computes the distance of this element to another element.
Declaration
public double DistanceTo(Real other)
Parameters
Type | Name | Description |
---|---|---|
Real | other |
Returns
Type | Description |
---|---|
Double | The value of the distance between the two elements. |
Divide(Real, Real)
Computes the division of two Real numbers.
Declaration
public static Real Divide(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number to divide. |
Real | right | Real number to divide with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the division. |
Divide(Real, Double)
Computes the scalar division of a Real number with a
Declaration
public static Real Divide(Real operand, double divisor)
Parameters
Type | Name | Description |
---|---|---|
Real | operand | Real number to divide. |
Double | divisor |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the scalar division. |
DotProduct(Real)
Computes the dot product of this element with another element.
Declaration
public double DotProduct(Real other)
Parameters
Type | Name | Description |
---|---|---|
Real | other |
Returns
Type | Description |
---|---|
Double | The value of the dot product of the two elements. |
Equals(Real)
Structure defining a real number.
Declaration
public bool Equals(Real other)
Parameters
Type | Name | Description |
---|---|---|
Real | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Structure defining a real number.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Structure defining a real number.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Inverse(Real)
Computes the inverse of the Real number.
Declaration
public static Real Inverse(Real operand)
Parameters
Type | Name | Description |
---|---|---|
Real | operand | Real number from which the inverse is computed. |
Returns
Type | Description |
---|---|
Real | The new Real number, inverse of the initial one. |
Multiply(Real, Real)
Computes the multiplication of two Real numbers.
Declaration
public static Real Multiply(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number for the multiplication. |
Real | right | Right Real number for the multiplication. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the multiplication. |
Multiply(Real, Double)
Computes the left scalar multiplication of a Real number with a
Declaration
public static Real Multiply(Real operand, double factor)
Parameters
Type | Name | Description |
---|---|---|
Real | operand | Real number to multiply. |
Double | factor |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the scalar multiplication. |
Multiply(Double, Real)
Computes the right scalar multiplication of a Real number with a
Declaration
public static Real Multiply(double factor, Real operand)
Parameters
Type | Name | Description |
---|---|---|
Double | factor | |
Real | operand | Real number to multiply. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the scalar multiplication. |
Norm()
Computes the norm of this element.
Declaration
public double Norm()
Returns
Type | Description |
---|---|
Double | The value of the norm. |
Opposite(Real)
Computes the opposite of the Real number.
Declaration
public static Real Opposite(Real operand)
Parameters
Type | Name | Description |
---|---|---|
Real | operand | Real number from which the opposite is computed. |
Returns
Type | Description |
---|---|
Real | The new Real number, opposite of the initial one. |
Subtract(Real, Real)
Computes the subtraction of two Real numbers.
Declaration
public static Real Subtract(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number to subtract. |
Real | right | Right Real number to subtract with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the subtraction. |
ToString()
Structure defining a real number.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Operators
| Improve this Doc View SourceAddition(Real, Real)
Computes the addition of two Real numbers.
Declaration
public static Real operator +(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number for the addition. |
Real | right | Right Real number for the addition. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the addition. |
Addition(Real, Double)
Computes the right addition of a Real number with a
Declaration
public static Real operator +(Real left, double right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number for the addition. |
Double | right |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the addition. |
Addition(Double, Real)
Computes the left addition of a Real number with a
Declaration
public static Real operator +(double left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Double | left | |
Real | right | Real number for the addition. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the addition. |
Division(Real, Real)
Computes the division of two Real numbers.
Declaration
public static Real operator /(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number to divide. |
Real | right | Real number to divide with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the division. |
Division(Real, Double)
Computes the division of a Real number with a
Declaration
public static Real operator /(Real left, double right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number to divide. |
Double | right |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the division. |
Division(Double, Real)
Computes the division of a
Declaration
public static Real operator /(double left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Double | left | |
Real | right | Real number to divide with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the division. |
Explicit(Real to Double)
Converts a Real number into a
Declaration
public static explicit operator double (Real real)
Parameters
Type | Name | Description |
---|---|---|
Real | real | Real number to convert. |
Returns
Type | Description |
---|---|
Double | The new |
Explicit(Double to Real)
Converts a
Declaration
public static explicit operator Real(double number)
Parameters
Type | Name | Description |
---|---|---|
Double | number |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the conversion. |
Multiply(Real, Real)
Computes the multiplication of two Real numbers.
Declaration
public static Real operator *(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number for the multiplication. |
Real | right | Right Real number for the multiplication. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the multiplication. |
Multiply(Real, Double)
Computes the right multiplication of a Real number with a
Declaration
public static Real operator *(Real left, double right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number for the multiplicaion. |
Double | right |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the multiplication. |
Multiply(Double, Real)
Computes the left multiplication of a Real number with a
Declaration
public static Real operator *(double left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Double | left | |
Real | right | Real number for the multiplicaion. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the multiplication. |
Subtraction(Real, Real)
Computes the subtraction of two Real numbers.
Declaration
public static Real operator -(Real left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Left Real number to subtract. |
Real | right | Right Real number to subtract with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the subtraction. |
Subtraction(Real, Double)
Computes the subtraction of a Real number with a
Declaration
public static Real operator -(Real left, double right)
Parameters
Type | Name | Description |
---|---|---|
Real | left | Real number to subtract. |
Double | right |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the subtraction. |
Subtraction(Double, Real)
Computes the subtraction of a
Declaration
public static Real operator -(double left, Real right)
Parameters
Type | Name | Description |
---|---|---|
Double | left | |
Real | right | Real number to subtract with. |
Returns
Type | Description |
---|---|
Real | The new Real number resulting from the subtraction. |
UnaryNegation(Real)
Computes the opposite of the Real number.
Declaration
public static Real operator -(Real operand)
Parameters
Type | Name | Description |
---|---|---|
Real | operand | Real number from which the opposite is computed. |
Returns
Type | Description |
---|---|
Real | The new Real number, opposite of the initial one. |
Explicit Interface Implementations
| Improve this Doc View SourceIGroupAction<Real, Double>.Divide(Double)
Computes the right scalar division of the current element.
Declaration
Real IGroupAction<Real, double>.Divide(double divisor)
Parameters
Type | Name | Description |
---|---|---|
Double | divisor |
Returns
Type | Description |
---|---|
Real | The new element resulting from the scalar dividion. |
IGroupAction<Real, Double>.Multiply(Double)
Computes the right scalar multiplication of the current element.
Declaration
Real IGroupAction<Real, double>.Multiply(double factor)
Parameters
Type | Name | Description |
---|---|---|
Double | factor |
Returns
Type | Description |
---|---|
Real | The new element resulting from the scalar multiplication. |