+
+
+
+
+ Struct Real
+
+
+
+
+
- Namespace
- Mathematics.NET.Core
+
- Assembly
- Mathematics.NET.dll
+
+
+ Represents a real number
+
+
+
+
+
[Serializable]
+public readonly struct Real : IReal<Real>, IInequalityRelations<Real, bool>, IDecrementOperation<Real>, IIncrementOperation<Real>, IComparable, IComparable<Real>, IMinMaxValue<Real>, IConstants<Real>, IDifferentiableFunctions<Real>, IComplex<Real>, IAdditionOperation<Real, Real>, IDivisionOperation<Real, Real>, IMultiplicationOperation<Real, Real>, INegationOperation<Real, Real>, ISubtractionOperation<Real, Real>, IEqualityRelation<Real, bool>, IEquatable<Real>, ISpanFormattable, IFormattable, ISpanParsable<Real>, IParsable<Real>
+
+
+
+
+
+
+
+ - Implements
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited Members
+ -
+
+
+
+
+
+
+
+
+
+
+ Constructors
+
+
+
+
+
+
+ Real(double)
+
+
+
+
+
+
+
+
public Real(double real)
+
+
+ Parameters
+
+ real
double
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fields
+
+
+
+
+
+ E
+
+
+
+ Represents the natural logarithmic base, \(e\)
+
+
+
+
+
public static readonly Real E
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EulerMascheroni
+
+
+
+ Represents the Euler-Mascheroni constant, \(\gamma\)
+
+
+
+
+
public static readonly Real EulerMascheroni
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GoldenRatio
+
+
+
+ Represents the golden ratio, \(\phi\)
+
+
+
+
+
public static readonly Real GoldenRatio
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ln10
+
+
+
+ Represents the natural logarithm of 10, \(\ln(10)\)
+
+
+
+
+
public static readonly Real Ln10
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ln2
+
+
+
+ Represents the natural logarithm of 2, \(\ln(2)\)
+
+
+
+
+
public static readonly Real Ln2
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MaxValue
+
+
+
+
+
+
+
+
public static readonly Real MaxValue
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MinValue
+
+
+
+
+
+
+
+
public static readonly Real MinValue
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NaN
+
+
+
+
+
+
+
+
public static readonly Real NaN
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NegativeInfinity
+
+
+
+
+
+
+
+
public static readonly Real NegativeInfinity
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
public static readonly Real One
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Pi
+
+
+
+ Represents the ratio of the circumference of a circle to its diameter, \(π\)
+
+
+
+
+
public static readonly Real Pi
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PiOverTwo
+
+
+
+
+
+
+
+
public static readonly Real PiOverTwo
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PiSquared
+
+
+
+
+
+
+
+
public static readonly Real PiSquared
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PositiveInfinity
+
+
+
+
+
+
+
+
public static readonly Real PositiveInfinity
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sqrt2
+
+
+
+ Represents the square root of 2, \(\sqrt{2}\)
+
+
+
+
+
public static readonly Real Sqrt2
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sqrt3
+
+
+
+ Represents the square root of 3, \(\sqrt{3}\)
+
+
+
+
+
public static readonly Real Sqrt3
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sqrt5
+
+
+
+ Represents the square root of 5, \(\sqrt{5}\)
+
+
+
+
+
public static readonly Real Sqrt5
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tau
+
+
+
+
+
+
+
+
public static readonly Real Tau
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Zero
+
+
+
+
+
+
+
+
public static readonly Real Zero
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ZetaOf2
+
+
+
+ Represents the solution to the Basel problem, \(\zeta(2) = \pi^2/6\)
+
+
+
+
+
public static readonly Real ZetaOf2
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ZetaOf3
+
+
+
+ Represents Apéry's constant, \(\zeta(3)\)
+
+
+
+
+
public static readonly Real ZetaOf3
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ZetaOf4
+
+
+
+ Represents \(\zeta(4) = \pi^4/90\)
+
+
+
+
+
public static readonly Real ZetaOf4
+
+
+
+
+
+ Field Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+ Properties
+
+
+
+
+
+
+ Re
+
+
+
+ The real part of the complex number
+
+
+
+
+
public Real Re { get; }
+
+
+
+
+
+
+ Property Value
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+ The backing value of the type
+
+
+
+
+
public double Value { get; }
+
+
+
+
+
+
+ Property Value
+
+ - double
+
+
+
+
+
+
+
+
+
+
+ Methods
+
+
+
+
+
+
+ Abs(Real)
+
+
+
+ Compute the absolute value of a number
+
+
+
+
+
public static Real Abs(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - Real
+ The absolute value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Acos(Real)
+
+
+
+ Compute the arccosine of x
: \(\cos^{-1}(x)\)
+
+
+
+
+
public static Real Acos(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The arccosine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Acosh(Real)
+
+
+
+ Compute the hyperbolic arccosine of x
: \(\cosh^{-1}(x)\)
+
+
+
+
+
public static Real Acosh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic arccosine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Asin(Real)
+
+
+
+ Compute the arcsine of x
: \(\sin^{-1}(x)\)
+
+
+
+
+
public static Real Asin(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The arcsine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Asinh(Real)
+
+
+
+ Compute the hyperbolic arcsine of x
: \(\sinh^{-1}(x)\)
+
+
+
+
+
public static Real Asinh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic arcsine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Atan(Real)
+
+
+
+ Compute the arctangent of x
: \(\tan^{-1}(x)\)
+
+
+
+
+
public static Real Atan(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The arctangent of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Atan2(Real, Real)
+
+
+
+
+
+
+
+
public static Real Atan2(Real y, Real x)
+
+
+ Parameters
+
+ y
Real
+
+ x
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Atanh(Real)
+
+
+
+ Compute the hyperbolic arctangent of x
: \(\tanh^{-1}(x)\)
+
+
+
+
+
public static Real Atanh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic arctangent of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cbrt(Real)
+
+
+
+ Compute the cuberoot of x
: \(\sqrt[3]{x}\)
+
+
+
+
+
public static Real Cbrt(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The cuberoot of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CompareTo(Real)
+
+
+
+ Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
+
+
+
+
+
public int CompareTo(Real value)
+
+
+ Parameters
+
+ value
Real
+
+
+
+ Returns
+
+ - int
+ A value that indicates the relative order of the objects being compared. The return value has these meanings:
+ Value | Meaning |
---|
Less than zero | This instance precedes other in the sort order. |
Zero | This instance occurs in the same position in the sort order as other . |
Greater than zero | This instance follows other in the sort order. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CompareTo(object?)
+
+
+
+ Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
+
+
+
+
+
public int CompareTo(object? obj)
+
+
+ Parameters
+
+ obj
object
+ An object to compare with this instance.
+
+
+
+ Returns
+
+ - int
+ A value that indicates the relative order of the objects being compared. The return value has these meanings:
+ Value | Meaning |
---|
Less than zero | This instance precedes obj in the sort order. |
Zero | This instance occurs in the same position in the sort order as obj . |
Greater than zero | This instance follows obj in the sort order. |
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentException
+ obj
is not the same type as this instance.
+
+
+
+
+
+
+
+
+ Conjugate(Real)
+
+
+
+ Compute the complex conjugate of a number
+
+
+
+
+
public static Real Conjugate(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - Real
+ The complex conjugate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cos(Real)
+
+
+
+ Compute the cosine of x
: \(\cos(x)\)
+
+
+
+
+
public static Real Cos(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The cosine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cosh(Real)
+
+
+
+ Compute the hyperbolic cosine of x
: \(\cosh(x)\)
+
+
+
+
+
public static Real Cosh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic cosine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Equals(Real)
+
+
+
+ Indicates whether the current object is equal to another object of the same type.
+
+
+
+
+
public bool Equals(Real value)
+
+
+ Parameters
+
+ value
Real
+
+
+
+ Returns
+
+ - bool
+ true if the current object is equal to the other
parameter; otherwise, false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Equals(object?)
+
+
+
+ Indicates whether this instance and a specified object are equal.
+
+
+
+
+
public override bool Equals(object? obj)
+
+
+ Parameters
+
+ obj
object
+ The object to compare with the current instance.
+
+
+
+ Returns
+
+ - bool
+ true if obj
and this instance are the same type and represent the same value; otherwise, false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Exp(Real)
+
+
+
+ Compute e raised to the power of x
: \(e^x\)
+
+
+
+
+
public static Real Exp(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ e raised to the power of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Exp10(Real)
+
+
+
+ Compute 10 raised to the power of x
: \(10^x\)
+
+
+
+
+
public static Real Exp10(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ 10 raised to the power of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Exp2(Real)
+
+
+
+ Compute 2 raised to the power of x
: \(2^x\)
+
+
+
+
+
public static Real Exp2(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ 2 raised to the power of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FromDouble(double)
+
+
+
+ Create an instance of type Real from one of type double
+
+
+
+
+
public static Real FromDouble(double x)
+
+
+ Parameters
+
+ x
double
+ A value of type double
+
+
+
+ Returns
+
+ - Real
+ An instance of type Real created from x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FromReal(Real)
+
+
+
+ Create an instance of type Real from one of type Real
+
+
+
+
+
public static Real FromReal(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value of type Real
+
+
+
+ Returns
+
+ - Real
+ An instance of type Real created from x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GetHashCode()
+
+
+
+ Returns the hash code for this instance.
+
+
+
+
+
public override int GetHashCode()
+
+
+
+ Returns
+
+ - int
+ A 32-bit signed integer that is the hash code for this instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Hypot(Real, Real)
+
+
+
+
+
+
+
+
public static Real Hypot(Real x, Real y)
+
+
+ Parameters
+
+ x
Real
+
+ y
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsFinite(Real)
+
+
+
+ Check if a value is finite
+
+
+
+
+
public static bool IsFinite(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - bool
+ true if the value is finite; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsInfinity(Real)
+
+
+
+ Check if a value is infinity
+
+
+
+
+
public static bool IsInfinity(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - bool
+ true if the value is infinity; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsNaN(Real)
+
+
+
+ Checks if a value is not a number
+
+
+
+
+
public static bool IsNaN(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - bool
+ true if the value is not a number; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsNegativeInfinity(Real)
+
+
+
+ Check if a value is negative infinity
+
+
+
+
+
public static bool IsNegativeInfinity(Real x)
+
+
+ Parameters
+
+ x
Real
+ The value to check
+
+
+
+ Returns
+
+ - bool
+ true
if the value is negative infinity; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsPositiveInfinity(Real)
+
+
+
+ Check if a valule is positive infinity
+
+
+
+
+
public static bool IsPositiveInfinity(Real x)
+
+
+ Parameters
+
+ x
Real
+ The value to check
+
+
+
+ Returns
+
+ - bool
+ true
if the value is positive infinity; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsZero(Real)
+
+
+
+ Check if a value is zero
+
+
+
+
+
public static bool IsZero(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - bool
+ true if the value is zero; otherwise, false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ln(Real)
+
+
+
+ Compute the natural logarithm of x
: \(\ln(x)\)
+
+
+
+
+
public static Real Ln(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The natural logarithm ofx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Log(Real, Real)
+
+
+
+ Compute the logarithm of x
to base b
: \(\log_b(x)\)
+
+
+
+
+
public static Real Log(Real x, Real b)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+ b
Real
+ A base
+
+
+
+ Returns
+
+ - Real
+ The natural logarithm of x
to base b
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Log10(Real)
+
+
+
+ Compute the logarithm of x
to base 10: \(\log_{10}(x)\)
+
+
+
+
+
public static Real Log10(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The natural logarithm of x
to base 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Log2(Real)
+
+
+
+ Compute the logarithm of x
to base 2: \(\log_2(x)\)
+
+
+
+
+
public static Real Log2(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The natural logarithm of x
to base 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Max(Real, Real)
+
+
+
+ Find which of two numbers is greater than the other
+
+
+
+
+
public static Real Max(Real x, Real y)
+
+
+ Parameters
+
+ x
Real
+ The first value
+
+ y
Real
+ The second value
+
+
+
+ Returns
+
+ - Real
+ The greater of the two values
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Min(Real, Real)
+
+
+
+ Find which of two numbers is less than the other
+
+
+
+
+
public static Real Min(Real x, Real y)
+
+
+ Parameters
+
+ x
Real
+ The first value
+
+ y
Real
+ The second value
+
+
+
+ Returns
+
+ - Real
+ The lesser of the two values
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Parse a span of characters into a value
+
+
+
+
+
public static Real Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.AllowThousands | NumberStyles.Float, IFormatProvider? provider = null)
+
+
+ Parameters
+
+ s
ReadOnlySpan<char>
+ The span of characters to parse
+
+ style
NumberStyles
+ The number style
+
+ provider
IFormatProvider
+ The culture-specific formatting information about the span of characters
+
+
+
+ Returns
+
+ - Real
+ The parse result
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentException
+ style
is not a supported
+
+ - ArgumentNullException
+ s
is null
+
+
+
+
+
+
+
+
+
+ Parses a span of characters into a value.
+
+
+
+
+
public static Real Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
+
+
+ Parameters
+
+ s
ReadOnlySpan<char>
+ The span of characters to parse.
+
+ provider
IFormatProvider
+ An object that provides culture-specific formatting information about s
.
+
+
+
+ Returns
+
+ - Real
+ The result of parsing s
.
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - FormatException
+ s
is not in the correct format.
+
+ - OverflowException
+ s
is not representable by Real.
+
+
+
+
+
+
+
+
+
+ Parse a string into a value
+
+
+
+
+
public static Real Parse(string s, NumberStyles style, IFormatProvider? provider)
+
+
+ Parameters
+
+ s
string
+ The string to parse
+
+ style
NumberStyles
+ The number style
+
+ provider
IFormatProvider
+ The culture-specific formatting information about the string
+
+
+
+ Returns
+
+ - Real
+ The parse result
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentException
+ style
is not a supported
+
+ - ArgumentNullException
+ s
is null
+
+
+
+
+
+
+
+
+
+ Parses a string into a value.
+
+
+
+
+
public static Real Parse(string s, IFormatProvider? provider)
+
+
+ Parameters
+
+ s
string
+ The string to parse.
+
+ provider
IFormatProvider
+ An object that provides culture-specific formatting information about s
.
+
+
+
+ Returns
+
+ - Real
+ The result of parsing s
.
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentNullException
+ s
is null.
+
+ - FormatException
+ s
is not in the correct format.
+
+ - OverflowException
+ s
is not representable by Real.
+
+
+
+
+
+
+
+
+ Pow(Real, Real)
+
+
+
+ Compute x
raised to the power of y
: \(x^y\)
+
+
+
+
+
public static Real Pow(Real x, Real y)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+ y
Real
+ A power
+
+
+
+ Returns
+
+ - Real
+ x
raised to the power of y
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reciprocate(Real)
+
+
+
+ Compute the reciprocal of a number
+
+
+
+
+
public static Real Reciprocate(Real x)
+
+
+ Parameters
+
+ x
Real
+
+
+
+ Returns
+
+ - Real
+ The reciprocal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Root(Real, Real)
+
+
+
+ Compute the n
th root of x
: \(\sqrt[n]{x}\)
+
+
+
+
+
public static Real Root(Real x, Real y)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+ y
Real
+
+
+
+ Returns
+
+ - Real
+ The n
th root of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sign(Real)
+
+
+
+ Find the sign of a real number
+
+
+
+
+
public static int Sign(Real x)
+
+
+ Parameters
+
+ x
Real
+ The value to check
+
+
+
+ Returns
+
+ - int
+ A number indicating the sign of the value:
1 if the value is greater than zero
0 if the value is greater than zero
-1 if the value is less than zero
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArithmeticException
+ An overflow or underflow has occurred
+
+
+
+
+
+
+
+
+ Sin(Real)
+
+
+
+ Compute the sine of x
: \(\sin(x)\)
+
+
+
+
+
public static Real Sin(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The sine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sinh(Real)
+
+
+
+ Compute the hyperbolic sine of x
: \(\sinh(x)\)
+
+
+
+
+
public static Real Sinh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic sine of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sqrt(Real)
+
+
+
+ Compute the square root of x
: \(\sqrt{x}\)
+
+
+
+
+
public static Real Sqrt(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The square root of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tan(Real)
+
+
+
+ Compute the tangent of x
: \(\tan(x)\)
+
+
+
+
+
public static Real Tan(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The tangent of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tanh(Real)
+
+
+
+ Compute the hyperbolic tangent of x
: \(\tanh(x)\)
+
+
+
+
+
public static Real Tanh(Real x)
+
+
+ Parameters
+
+ x
Real
+ A value
+
+
+
+ Returns
+
+ - Real
+ The hyperbolic tangent of x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ToString()
+
+
+
+ Returns the fully qualified type name of this instance.
+
+
+
+
+
public override string ToString()
+
+
+
+ Returns
+
+ - string
+ The fully qualified type name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Formats the value of the current instance using the specified format.
+
+
+
+
+
public string ToString(string? format, IFormatProvider? provider)
+
+
+ Parameters
+
+ format
string
+ The format to use.
+-or-
+A null reference (Nothing
in Visual Basic) to use the default format defined for the type of the IFormattable implementation.
+
+ provider
IFormatProvider
+
+
+
+ Returns
+
+ - string
+ The value of the current instance in the specified format.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TryConvertFromChecked<U>(U, out Real)
+
+
+
+ Try to convert a value to one of the current type, and throw and overflow exception if the value falls outside the representable range.
+
+
+
+
+
public static bool TryConvertFromChecked<U>(U value, out Real result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
U
+ The value to convert
+
+ result
Real
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The type from which to convert
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - OverflowException
+ The value is not representable by the type Real.
+
+
+
+
+
+
+
+
+ TryConvertFromSaturating<U>(U, out Real)
+
+
+
+ Try to convert a value to one of the current type, and saturate values that fall outside the representable range.
+
+
+
+
+
public static bool TryConvertFromSaturating<U>(U value, out Real result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
U
+ The value to convert
+
+ result
Real
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The type from which to convert
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TryConvertFromTruncating<U>(U, out Real)
+
+
+
+ Try to convert a value to one of the current type, and truncate values that fall outside the representable range.
+
+
+
+
+
public static bool TryConvertFromTruncating<U>(U value, out Real result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
U
+ The value to convert
+
+ result
Real
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The type from which to convert
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TryConvertToChecked<U>(Real, out U)
+
+
+
+ Try to convert a value to one of another type, and throw and overflow exception if the value falls outside the representable range.
+
+
+
+
+
public static bool TryConvertToChecked<U>(Real value, out U result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
Real
+ The value to convert
+
+ result
U
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The target type
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - OverflowException
+ The value is not representable by the target type.
+
+
+
+
+
+
+
+
+ TryConvertToSaturating<U>(Real, out U)
+
+
+
+ Try to convert a value to one of another type, and saturate values that fall outside of the representable range.
+
+
+
+
+
public static bool TryConvertToSaturating<U>(Real value, out U result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
Real
+ The value to convert
+
+ result
U
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The target type
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TryConvertToTruncating<U>(Real, out U)
+
+
+
+ Try to convert a value to one of another type, and truncate values that fall outside of the representable range.
+
+
+
+
+
public static bool TryConvertToTruncating<U>(Real value, out U result) where U : INumberBase<U>
+
+
+ Parameters
+
+ value
Real
+ The value to convert
+
+ result
U
+ The result of the conversion
+
+
+
+ Returns
+
+ - bool
+ true if the conversion was successful; otherwise, false
+
+
+
+ Type Parameters
+
+ U
+ The target type
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tries to format the value of the current instance into the provided span of characters.
+
+
+
+
+
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
+
+
+ Parameters
+
+ destination
Span<char>
+ The span in which to write this instance's value formatted as a span of characters.
+
+ charsWritten
int
+ When this method returns, contains the number of characters that were written in destination
.
+
+ format
ReadOnlySpan<char>
+ A span containing the characters that represent a standard or custom format string that defines the acceptable format for destination
.
+
+ provider
IFormatProvider
+ An optional object that supplies culture-specific formatting information for destination
.
+
+
+
+ Returns
+
+ - bool
+ true if the formatting was successful; otherwise, false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Try to parse a span of characters into a value
+
+
+
+
+
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out Real result)
+
+
+ Parameters
+
+ s
ReadOnlySpan<char>
+ The span of characters to parse
+
+ style
NumberStyles
+ The number style
+
+ provider
IFormatProvider
+ The culture-specific formatting information about the span of characters
+
+ result
Real
+ The result of the parse or a default value if the parse was unsuccessful
+
+
+
+ Returns
+
+ - bool
+ true if the parse was successful; otherwise, false
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentException
+ style
is not a supported
+
+
+
+
+
+
+
+
+
+ Tries to parse a span of characters into a value.
+
+
+
+
+
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Real result)
+
+
+ Parameters
+
+ s
ReadOnlySpan<char>
+ The span of characters to parse.
+
+ provider
IFormatProvider
+ An object that provides culture-specific formatting information about s
.
+
+ result
Real
+ When this method returns, contains the result of successfully parsing s
, or an undefined value on failure.
+
+
+
+ Returns
+
+ - bool
+ true if s
was successfully parsed; otherwise, false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Try to parse a string into a value
+
+
+
+
+
public static bool TryParse(string? s, NumberStyles style, IFormatProvider? provider, out Real result)
+
+
+ Parameters
+
+ s
string
+ The string to parse
+
+ style
NumberStyles
+ The number style
+
+ provider
IFormatProvider
+ The culture-specific formatting information about the string
+
+ result
Real
+ The result of the parse or a default value if the parse was unsuccessful
+
+
+
+ Returns
+
+ - bool
+ true if the parse was successful; otherwise, false
+
+
+
+
+
+
+
+
+
+
+ Exceptions
+
+ - ArgumentException
+ style
is not a supported
+
+
+
+
+
+
+
+
+
+ Tries to parse a string into a value.
+
+
+
+
+
public static bool TryParse(string? s, IFormatProvider? provider, out Real result)
+
+
+ Parameters
+
+ s
string
+ The string to parse.
+
+ provider
IFormatProvider
+ An object that provides culture-specific formatting information about s
.
+
+ result
Real
+ When this method returns, contains the result of successfully parsing s
or an undefined value on failure.
+
+
+
+ Returns
+
+ - bool
+ true if s
was successfully parsed; otherwise, false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Operators
+
+
+
+
+
+
+ operator +(Real, Real)
+
+
+
+
+
+
+
+
public static Real operator +(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator --(Real)
+
+
+
+
+
+
+
+
public static Real operator --(Real value)
+
+
+ Parameters
+
+ value
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator /(Real, Real)
+
+
+
+
+
+
+
+
public static Real operator /(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator ==(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator ==(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator >(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator >(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator >=(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator >=(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ implicit operator Real(double)
+
+
+
+
+
+
+
+
public static implicit operator Real(double x)
+
+
+ Parameters
+
+ x
double
+ The value to convert
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator ++(Real)
+
+
+
+
+
+
+
+
public static Real operator ++(Real value)
+
+
+ Parameters
+
+ value
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator !=(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator !=(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator <(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator <(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator <=(Real, Real)
+
+
+
+
+
+
+
+
public static bool operator <=(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator *(Real, Real)
+
+
+
+
+
+
+
+
public static Real operator *(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator -(Real, Real)
+
+
+
+
+
+
+
+
public static Real operator -(Real left, Real right)
+
+
+ Parameters
+
+ left
Real
+
+ right
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ operator -(Real)
+
+
+
+
+
+
+
+
public static Real operator -(Real value)
+
+
+ Parameters
+
+ value
Real
+
+
+
+ Returns
+
+ - Real
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+