Table of Contents

Struct BigDecimal

Operators and methods for comparing BigDecimals.

Implements
IConvertible
IFloatingPoint<BigDecimal>
IPowerFunctions<BigDecimal>
IRootFunctions<BigDecimal>
IExponentialFunctions<BigDecimal>
ILogarithmicFunctions<BigDecimal>
ICloneable
ITrigonometricFunctions<BigDecimal>
IHyperbolicFunctions<BigDecimal>
Namespace: Galaxon.Numerics
Assembly: Galaxon.Numerics.BigDecimal.dll
Syntax
public struct BigDecimal

Constructors

BigDecimal()

Default constructor.

Declaration
public BigDecimal()
| Improve this Doc View Source

BigDecimal(BigInteger, Int32, Boolean)

Main constructor.

Declaration
public BigDecimal(BigInteger significand, int exponent = 0, bool roundSigFigs = false)
Parameters
Type Name Description
BigInteger significand

The significand or mantissa.

System.Int32 exponent

The exponent.

System.Boolean roundSigFigs

If the value should be rounded off to the current value of MaxSigFigs.

| Improve this Doc View Source

Fields

DecimalPrecision

Precision supported by the decimal type.

Declaration
public const int DecimalPrecision = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

DoublePrecision

Precision supported by the double type.

Declaration
public const int DoublePrecision = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

FloatPrecision

Precision supported by the float type.

Declaration
public const int FloatPrecision = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

HalfPrecision

Precision supported by the Half type.

Declaration
public const int HalfPrecision = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

Properties

AdditiveIdentity

Declaration
public static readonly BigDecimal AdditiveIdentity { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

E

Declaration
public static readonly BigDecimal E { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Exponent

The power of 10.

Declaration
public int Exponent { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Ln10

The natural logarithm of 10.

Declaration
public static readonly BigDecimal Ln10 { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

MaxSigFigs

This property determines the maximum number of significant figures to keep in a BigDecimal value.

After any calculation, the result will be rounded to this many significant figures. This not only helps control memory usage by controlling the size of the significand, but also determines when to halt numerical methods, e.g. for calculating a square root or logarithm.

If this property is modified, only new objects and calculations are affected by it. If you want to reduce the number of significant figures in an existing value, use RoundSigFigs().

Declaration
public static int MaxSigFigs { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

MultiplicativeIdentity

Declaration
public static readonly BigDecimal MultiplicativeIdentity { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

NegativeOne

Declaration
public static readonly BigDecimal NegativeOne { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

NumSigFigs

Get the number of significant figures.

Declaration
public readonly int NumSigFigs { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

One

Declaration
public static readonly BigDecimal One { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Phi

The golden ratio (φ).

Declaration
public static readonly BigDecimal Phi { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Pi

Declaration
public static readonly BigDecimal Pi { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Radix

Declaration
public static readonly int Radix { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Sign

The sign of the value. The same convention is used as for BigInteger except sbyte is used instead of an int. -1 for negative 0 for zero 1 for positive

Declaration
public readonly sbyte Sign { get; }
Property Value
Type Description
System.SByte
| Improve this Doc View Source

Significand

The part of a number in scientific notation or in floating-point representation, consisting of its significant digits.

Declaration
public BigInteger Significand { get; set; }
Property Value
Type Description
BigInteger
| Improve this Doc View Source

Tau

Declaration
public static readonly BigDecimal Tau { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Zero

Declaration
public static readonly BigDecimal Zero { get; }
Property Value
Type Description
BigDecimal
| Improve this Doc View Source

Methods

Abs(BigDecimal)

Declaration
public static BigDecimal Abs(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Acos(BigDecimal)

Declaration
public static BigDecimal Acos(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Acosh(BigDecimal)

Declaration
public static BigDecimal Acosh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

AcosPi(BigDecimal)

Declaration
public static BigDecimal AcosPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

ArithmeticGeometricMean(BigDecimal, BigDecimal)

Compute the arithmetic-geometric mean of two values.

Declaration
public static BigDecimal ArithmeticGeometricMean(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Asin(BigDecimal)

Declaration
public static BigDecimal Asin(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Asinh(BigDecimal)

Declaration
public static BigDecimal Asinh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

AsinPi(BigDecimal)

Declaration
public static BigDecimal AsinPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Atan(BigDecimal)

Declaration
public static BigDecimal Atan(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Atanh(BigDecimal)

Declaration
public static BigDecimal Atanh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

AtanPi(BigDecimal)

Declaration
public static BigDecimal AtanPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Average(BigDecimal[])

Compute the arithmetic mean (average) of the given values. If you have a collection, you can use the extension method directly instead.

Declaration
public static BigDecimal Average(params BigDecimal[] nums)
Parameters
Type Name Description
BigDecimal[] nums
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Cbrt(BigDecimal)

Calculate the cube root of a real number.

Declaration
public static BigDecimal Cbrt(BigDecimal x)
Parameters
Type Name Description
BigDecimal x

The number.

Returns
Type Description
BigDecimal

The cube root of the number.

| Improve this Doc View Source

Ceiling(BigDecimal)

Declaration
public static BigDecimal Ceiling(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
Remarks

This method should not need to be implemented because it's a static virtual method and the default implementation is what we want. However, static virtual methods are not yet supported by Rider so we need this here for now.

| Improve this Doc View Source

Clone()

Declaration
public object Clone()
Returns
Type Description
System.Object
| Improve this Doc View Source

CompareTo(BigDecimal)

Declaration
public int CompareTo(BigDecimal other)
Parameters
Type Name Description
BigDecimal other
Returns
Type Description
System.Int32
| Improve this Doc View Source

CompareTo(Nullable<Object>)

Declaration
public int CompareTo(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Int32
| Improve this Doc View Source

ComputePhi()

Compute the value of phi (φ), the golden ration.

Declaration
public static BigDecimal ComputePhi()
Returns
Type Description
BigDecimal

The value of φ to the current number of significant figures.

| Improve this Doc View Source

ComputePi()

Compute π.

The Chudnovsky algorithm used here was the one used to generate π to 6.2 trillion decimal places, the current world record. See: https://en.wikipedia.org/wiki/Chudnovsky_algorithm

Declaration
public static BigDecimal ComputePi()
Returns
Type Description
BigDecimal
| Improve this Doc View Source

ComputeTau()

Compute the value of tau (τ), equal to 2 * pi (2π).

Declaration
public static BigDecimal ComputeTau()
Returns
Type Description
BigDecimal

The value of τ to the current number of significant figures.

| Improve this Doc View Source

Cos(BigDecimal)

Declaration
public static BigDecimal Cos(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Cosh(BigDecimal)

Declaration
public static BigDecimal Cosh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

CosPi(BigDecimal)

Declaration
public static BigDecimal CosPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Cube(BigDecimal)

Calculate the cube of a number.

Declaration
public static BigDecimal Cube(BigDecimal x)
Parameters
Type Name Description
BigDecimal x

A real value.

Returns
Type Description
BigDecimal

The cube of the argument.

| Improve this Doc View Source

Equals(BigDecimal)

Declaration
public bool Equals(BigDecimal other)
Parameters
Type Name Description
BigDecimal other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Nullable<Object>)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Exp(BigDecimal)

Declaration
public static BigDecimal Exp(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Exp10(BigDecimal)

Declaration
public static BigDecimal Exp10(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Exp2(BigDecimal)

Declaration
public static BigDecimal Exp2(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Floor(BigDecimal)

Declaration
public static BigDecimal Floor(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
Remarks

This method should not need to be implemented because it's a static virtual method and the default implementation is what we want. However, static virtual methods are not yet supported by Rider so we need this here for now.

| Improve this Doc View Source

Frac(BigDecimal)

Return the fractional part of the value.

There are multiple ways to define the frac() function for negative numbers. (Refer to the Wikipedia link below.) The definition used in this implementation simply takes the digits to the right of the decimal point, with the sign matching the argument.

e.g. Frac(12.345) => 0.345 Frac(-12.345) => -0.345

The following expression will be true for both positive and negative numbers: x == Truncate(x) + Frac(x)

Declaration
public static BigDecimal Frac(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

GeometricMean(BigDecimal[])

Compute the geometric mean of the given values. If you have a collection, you can use the extension method directly instead.

Declaration
public static BigDecimal GeometricMean(params BigDecimal[] nums)
Parameters
Type Name Description
BigDecimal[] nums
Returns
Type Description
BigDecimal
| Improve this Doc View Source

GetExponentByteCount()

Declaration
public int GetExponentByteCount()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetExponentShortestBitLength()

Declaration
public int GetExponentShortestBitLength()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetSignificandBitLength()

Declaration
public int GetSignificandBitLength()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetSignificandByteCount()

Declaration
public int GetSignificandByteCount()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetTypeCode()

Declaration
public TypeCode GetTypeCode()
Returns
Type Description
TypeCode
| Improve this Doc View Source

Hypot(BigDecimal, BigDecimal)

Calculate the length of the hypotenuse of a right triangle.

Declaration
public static BigDecimal Hypot(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x

The length of one of the short sides of the triangle.

BigDecimal y

The length of the other short side of the triangle.

Returns
Type Description
BigDecimal

The length of the hypotenuse.

| Improve this Doc View Source

IsCanonical(BigDecimal)

Checks if the value is in its canonical state. In this case, the value should not be evenly divisible by 10. In canonical form, a multiple of 10 should be shortened and the exponent increased.

Declaration
public static bool IsCanonical(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsComplexNumber(BigDecimal)

Check if the value is a complex number.

Declaration
public static bool IsComplexNumber(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsEvenInteger(BigDecimal)

Declaration
public static bool IsEvenInteger(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsFinite(BigDecimal)

Declaration
public static bool IsFinite(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsImaginaryNumber(BigDecimal)

Declaration
public static bool IsImaginaryNumber(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsInfinity(BigDecimal)

Declaration
public static bool IsInfinity(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsInteger(BigDecimal)

The value will be an integer if in canonical form and the exponent is >= 0.

Declaration
public static bool IsInteger(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNaN(BigDecimal)

Declaration
public static bool IsNaN(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNegative(BigDecimal)

Declaration
public static bool IsNegative(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNegativeInfinity(BigDecimal)

Declaration
public static bool IsNegativeInfinity(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNormal(BigDecimal)

Declaration
public static bool IsNormal(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsOddInteger(BigDecimal)

Declaration
public static bool IsOddInteger(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsPositive(BigDecimal)

Declaration
public static bool IsPositive(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsPositiveInfinity(BigDecimal)

Declaration
public static bool IsPositiveInfinity(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsRealNumber(BigDecimal)

Declaration
public static bool IsRealNumber(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsSubnormal(BigDecimal)

Declaration
public static bool IsSubnormal(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsZero(BigDecimal)

Declaration
public static bool IsZero(BigDecimal value)
Parameters
Type Name Description
BigDecimal value
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Log(BigDecimal)

Declaration
public static BigDecimal Log(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Log(BigDecimal, BigDecimal)

Declaration
public static BigDecimal Log(BigDecimal x, BigDecimal b)
Parameters
Type Name Description
BigDecimal x
BigDecimal b
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Log10(BigDecimal)

Declaration
public static BigDecimal Log10(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Log2(BigDecimal)

Declaration
public static BigDecimal Log2(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

MaxMagnitude(BigDecimal, BigDecimal)

Declaration
public static BigDecimal MaxMagnitude(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
BigDecimal
| Improve this Doc View Source

MaxMagnitudeNumber(BigDecimal, BigDecimal)

Declaration
public static BigDecimal MaxMagnitudeNumber(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
BigDecimal
| Improve this Doc View Source

MinMagnitude(BigDecimal, BigDecimal)

Declaration
public static BigDecimal MinMagnitude(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
BigDecimal
| Improve this Doc View Source

MinMagnitudeNumber(BigDecimal, BigDecimal)

Declaration
public static BigDecimal MinMagnitudeNumber(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
BigDecimal
| Improve this Doc View Source

NormalizeAngle(in BigDecimal)

Shift given angle to the equivalent angle in the interval [-π, π).

Declaration
public static BigDecimal NormalizeAngle(in BigDecimal radians)
Parameters
Type Name Description
BigDecimal radians
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Parse(ReadOnlySpan<Char>, NumberStyles, Nullable<IFormatProvider>)

Declaration
public static BigDecimal Parse(ReadOnlySpan<char> span, NumberStyles style, IFormatProvider? provider)
Parameters
Type Name Description
ReadOnlySpan<System.Char> span
NumberStyles style
System.Nullable<IFormatProvider> provider
Returns
Type Description
BigDecimal
Remarks

Ignoring style parameter for now.

| Improve this Doc View Source

Parse(ReadOnlySpan<Char>, Nullable<IFormatProvider>)

Declaration
public static BigDecimal Parse(ReadOnlySpan<char> span, IFormatProvider? provider)
Parameters
Type Name Description
ReadOnlySpan<System.Char> span
System.Nullable<IFormatProvider> provider
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Parse(String)

More convenient version of Parse().

Declaration
public static BigDecimal Parse(string str)
Parameters
Type Name Description
System.String str
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Parse(String, NumberStyles, Nullable<IFormatProvider>)

Declaration
public static BigDecimal Parse(string str, NumberStyles style, IFormatProvider? provider)
Parameters
Type Name Description
System.String str
NumberStyles style
System.Nullable<IFormatProvider> provider
Returns
Type Description
BigDecimal
Remarks

Ignoring style parameter for now.

| Improve this Doc View Source

Parse(String, Nullable<IFormatProvider>)

Declaration
public static BigDecimal Parse(string strBigDecimal, IFormatProvider? provider)
Parameters
Type Name Description
System.String strBigDecimal
System.Nullable<IFormatProvider> provider
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Pow(BigDecimal, BigDecimal)

Calculate the value of x^y where x and y are both BigDecimal values.

Declaration
public static BigDecimal Pow(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x

The base.

BigDecimal y

The exponent.

Returns
Type Description
BigDecimal

The result of the calculation, rounded off to the current value of MaxSigFigs.

| Improve this Doc View Source

RootN(BigDecimal, Int32)

Declaration
public static BigDecimal RootN(BigDecimal x, int n)
Parameters
Type Name Description
BigDecimal x
System.Int32 n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Round(BigDecimal, MidpointRounding)

Declaration
public static BigDecimal Round(BigDecimal x, MidpointRounding mode)
Parameters
Type Name Description
BigDecimal x
MidpointRounding mode
Returns
Type Description
BigDecimal
Remarks

This method should not need to be implemented because it's a static virtual method and the default implementation is what we want. However, static virtual methods are not yet supported by Rider so we need this here for now.

| Improve this Doc View Source

Round(BigDecimal, Int32, MidpointRounding)

Declaration
public static BigDecimal Round(BigDecimal x, int digits = 0, MidpointRounding mode = null)
Parameters
Type Name Description
BigDecimal x
System.Int32 digits
MidpointRounding mode
Returns
Type Description
BigDecimal
| Improve this Doc View Source

RoundSigFigs(BigDecimal, Nullable<Int32>, MidpointRounding)

Round off a value to a certain number of significant figures.

Declaration
public static BigDecimal RoundSigFigs(BigDecimal x, int? maxSigFigs = null, MidpointRounding mode = null)
Parameters
Type Name Description
BigDecimal x
System.Nullable<System.Int32> maxSigFigs
MidpointRounding mode
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Sin(BigDecimal)

Declaration
public static BigDecimal Sin(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

SinCos(BigDecimal)

Declaration
public static (BigDecimal Sin, BigDecimal Cos) SinCos(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
System.ValueTuple<BigDecimal, BigDecimal>
| Improve this Doc View Source

SinCosPi(BigDecimal)

Declaration
public static (BigDecimal SinPi, BigDecimal CosPi) SinCosPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
System.ValueTuple<BigDecimal, BigDecimal>
| Improve this Doc View Source

Sinh(BigDecimal)

Declaration
public static BigDecimal Sinh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

SinPi(BigDecimal)

Declaration
public static BigDecimal SinPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Sqr(BigDecimal)

Calculate the square of a number.

Declaration
public static BigDecimal Sqr(BigDecimal x)
Parameters
Type Name Description
BigDecimal x

A real value.

Returns
Type Description
BigDecimal

The square of the argument.

| Improve this Doc View Source

Sqrt(BigDecimal)

Calculate the square root of a real number.

Declaration
public static BigDecimal Sqrt(BigDecimal x)
Parameters
Type Name Description
BigDecimal x

The number.

Returns
Type Description
BigDecimal

The square root of the number.

| Improve this Doc View Source

Tan(BigDecimal)

Declaration
public static BigDecimal Tan(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Tanh(BigDecimal)

Declaration
public static BigDecimal Tanh(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

TanPi(BigDecimal)

Declaration
public static BigDecimal TanPi(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
| Improve this Doc View Source

ToBoolean(Nullable<IFormatProvider>)

Declaration
public bool ToBoolean(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ToByte(Nullable<IFormatProvider>)

Declaration
public byte ToByte(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Byte
| Improve this Doc View Source

ToChar(Nullable<IFormatProvider>)

Declaration
public char ToChar(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Char
| Improve this Doc View Source

ToDateTime(Nullable<IFormatProvider>)

Declaration
public DateTime ToDateTime(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
DateTime
| Improve this Doc View Source

ToDecimal(Nullable<IFormatProvider>)

Declaration
public decimal ToDecimal(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Decimal
| Improve this Doc View Source

ToDouble(Nullable<IFormatProvider>)

Declaration
public double ToDouble(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Double
| Improve this Doc View Source

ToInt16(Nullable<IFormatProvider>)

Declaration
public short ToInt16(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Int16
| Improve this Doc View Source

ToInt32(Nullable<IFormatProvider>)

Declaration
public int ToInt32(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Int32
| Improve this Doc View Source

ToInt64(Nullable<IFormatProvider>)

Declaration
public long ToInt64(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Int64
| Improve this Doc View Source

ToSByte(Nullable<IFormatProvider>)

Declaration
public sbyte ToSByte(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.SByte
| Improve this Doc View Source

ToSingle(Nullable<IFormatProvider>)

Declaration
public float ToSingle(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Single
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Remarks

Override of ValueType.ToString(). Needed for debugging and string interpolation.

| Improve this Doc View Source

ToString(Nullable<IFormatProvider>)

Declaration
public string ToString(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.String
| Improve this Doc View Source

ToString(Nullable<String>, Nullable<IFormatProvider>)

Format the BigDecimal as a string.

Supported formats are the usual: D, E, F, G, N, P, and R. https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

Although "D" is normally only used by integral types, in this case both the significand and exponent will be formatted as integers.

An secondary code "U" is provided, which follows the precision (if given).

  • If omitted, the exponent (if present) will be formatted with the usual E[-+]999 format.
  • If present, the exponent is formatted with "×10" instead of "E" and the exponent digits will be rendered as superscript. Also, a "+" sign is not used for positive exponents, and the exponent digits are not zero-padded.

Example: "E7U" will format as per usual (E with 7 decimal digits), except using Unicode characters for the exponent part.

Codes "R" and "D" will produce the same output. However, the Unicode flag is undefined with "R", because Parse() doesn't support superscript exponents.

Declaration
public string ToString(string? specifier, IFormatProvider? provider = null)
Parameters
Type Name Description
System.Nullable<System.String> specifier

The format specifier (default "G").

System.Nullable<IFormatProvider> provider

The format provider (default null).

Returns
Type Description
System.String

The formatted string.

| Improve this Doc View Source

ToType(Type, Nullable<IFormatProvider>)

Declaration
public object ToType(Type conversionType, IFormatProvider? provider)
Parameters
Type Name Description
Type conversionType
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Object
| Improve this Doc View Source

ToUInt16(Nullable<IFormatProvider>)

Declaration
public ushort ToUInt16(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.UInt16
| Improve this Doc View Source

ToUInt32(Nullable<IFormatProvider>)

Declaration
public uint ToUInt32(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.UInt32
| Improve this Doc View Source

ToUInt64(Nullable<IFormatProvider>)

Declaration
public ulong ToUInt64(IFormatProvider? provider)
Parameters
Type Name Description
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.UInt64
| Improve this Doc View Source

Truncate(BigDecimal)

Declaration
public static BigDecimal Truncate(BigDecimal x)
Parameters
Type Name Description
BigDecimal x
Returns
Type Description
BigDecimal
Remarks

This method should not need to be implemented because it's a static virtual method and the default implementation is what we want. However, static virtual methods are not yet supported by Rider so we need this here for now.

| Improve this Doc View Source

TryConvertFromChecked<TOther>(TOther, out BigDecimal)

Declaration
public static bool TryConvertFromChecked<TOther>(TOther value, out BigDecimal result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
TOther value
BigDecimal result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryConvertFromSaturating<TOther>(TOther, out BigDecimal)

Declaration
public static bool TryConvertFromSaturating<TOther>(TOther value, out BigDecimal result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
TOther value
BigDecimal result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryConvertFromTruncating<TOther>(TOther, out BigDecimal)

Declaration
public static bool TryConvertFromTruncating<TOther>(TOther value, out BigDecimal result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
TOther value
BigDecimal result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryConvertToChecked<TOther>(BigDecimal, out TOther)

Declaration
public static bool TryConvertToChecked<TOther>(BigDecimal value, out TOther result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
BigDecimal value
TOther result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryConvertToSaturating<TOther>(BigDecimal, out TOther)

Declaration
public static bool TryConvertToSaturating<TOther>(BigDecimal value, out TOther result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
BigDecimal value
TOther result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryConvertToTruncating<TOther>(BigDecimal, out TOther)

Declaration
public static bool TryConvertToTruncating<TOther>(BigDecimal value, out TOther result)
    where TOther : INumberBase<TOther>
Parameters
Type Name Description
BigDecimal value
TOther result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TOther
| Improve this Doc View Source

TryFormat(Span<Char>, out Int32, ReadOnlySpan<Char>, Nullable<IFormatProvider>)

Declaration
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Parameters
Type Name Description
Span<System.Char> destination
System.Int32 charsWritten
ReadOnlySpan<System.Char> format
System.Nullable<IFormatProvider> provider
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryParse(ReadOnlySpan<Char>, NumberStyles, Nullable<IFormatProvider>, out BigDecimal)

Declaration
public static bool TryParse(ReadOnlySpan<char> span, NumberStyles style, IFormatProvider? provider, out BigDecimal result)
Parameters
Type Name Description
ReadOnlySpan<System.Char> span
NumberStyles style
System.Nullable<IFormatProvider> provider
BigDecimal result
Returns
Type Description
System.Boolean
Remarks

Ignoring style parameter for now.

| Improve this Doc View Source

TryParse(ReadOnlySpan<Char>, Nullable<IFormatProvider>, out BigDecimal)

Declaration
public static bool TryParse(ReadOnlySpan<char> span, IFormatProvider? provider, out BigDecimal result)
Parameters
Type Name Description
ReadOnlySpan<System.Char> span
System.Nullable<IFormatProvider> provider
BigDecimal result
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryParse(Nullable<String>, out BigDecimal)

More convenient version of TryParse().

Declaration
public static bool TryParse(string? str, out BigDecimal result)
Parameters
Type Name Description
System.Nullable<System.String> str
BigDecimal result
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryParse(Nullable<String>, NumberStyles, Nullable<IFormatProvider>, out BigDecimal)

Declaration
public static bool TryParse(string? str, NumberStyles style, IFormatProvider? provider, out BigDecimal result)
Parameters
Type Name Description
System.Nullable<System.String> str
NumberStyles style
System.Nullable<IFormatProvider> provider
BigDecimal result
Returns
Type Description
System.Boolean
Remarks

Ignoring style parameter for now.

| Improve this Doc View Source

TryParse(Nullable<String>, Nullable<IFormatProvider>, out BigDecimal)

Declaration
public static bool TryParse(string? str, IFormatProvider? provider, out BigDecimal result)
Parameters
Type Name Description
System.Nullable<System.String> str
System.Nullable<IFormatProvider> provider
BigDecimal result
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryWriteExponentBigEndian(Span<Byte>, out Int32)

Declaration
public bool TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten)
Parameters
Type Name Description
Span<System.Byte> destination
System.Int32 bytesWritten
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryWriteExponentLittleEndian(Span<Byte>, out Int32)

Declaration
public bool TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten)
Parameters
Type Name Description
Span<System.Byte> destination
System.Int32 bytesWritten
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryWriteSignificandBigEndian(Span<Byte>, out Int32)

Declaration
public bool TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten)
Parameters
Type Name Description
Span<System.Byte> destination
System.Int32 bytesWritten
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryWriteSignificandLittleEndian(Span<Byte>, out Int32)

Declaration
public bool TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
Parameters
Type Name Description
Span<System.Byte> destination
System.Int32 bytesWritten
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Operators

Addition(BigDecimal, BigDecimal)

Declaration
public static BigDecimal operator +(BigDecimal a, BigDecimal b)
Parameters
Type Name Description
BigDecimal a
BigDecimal b
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Decrement(BigDecimal)

Declaration
public static BigDecimal operator --(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Division(BigDecimal, BigDecimal)

Declaration
public static BigDecimal operator /(BigDecimal a, BigDecimal b)
Parameters
Type Name Description
BigDecimal a
BigDecimal b
Returns
Type Description
BigDecimal
Remarks

Computes division using the Goldschmidt algorithm. https://en.wikipedia.org/wiki/Division_algorithm#Goldschmidt_division

| Improve this Doc View Source

Equality(BigDecimal, BigDecimal)

Declaration
public static bool operator ==(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Explicit(BigRational to BigDecimal)

Explicit cast from BigRational to BigDecimal.

This cast operation has to be explicit as there could be loss of information due to the limit on the number of significant figures in the result of the division.

Declaration
public static explicit operator BigDecimal(BigRational n)
Parameters
Type Name Description
BigRational n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Explicit(BigDecimal to BigInteger)

Explicit cast from BigDecimal to BigInteger.

Declaration
public static explicit operator BigInteger(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigInteger
| Improve this Doc View Source

Explicit(BigDecimal to Half)

Explicit cast from BigDecimal to Half.

BigDecimal doesn't use a default precision for the "E" format specifier, so all digits will be rendered in the call to ToString(). This will produce the closest matching Half possible.

This method will not throw an OverflowException, but will return ±∞ for a value outside the valid range for Half.

Declaration
public static explicit operator Half(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
Half
| Improve this Doc View Source

Explicit(BigDecimal to Int128)

Explicit cast from BigDecimal to Int128.

Declaration
public static explicit operator Int128(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
Int128
| Improve this Doc View Source

Explicit(BigDecimal to Byte)

Explicit cast from BigDecimal to byte.

Declaration
public static explicit operator byte (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Byte
| Improve this Doc View Source

Explicit(BigDecimal to Decimal)

Explicit cast from BigDecimal to decimal.

Declaration
public static explicit operator decimal (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Decimal
| Improve this Doc View Source

Explicit(BigDecimal to Double)

Explicit cast from BigDecimal to double.

BigDecimal doesn't use a default precision for the "E" format specifier, so all digits will be rendered in the call to ToString(). This will produce the closest matching double possible.

This method will not throw an OverflowException, but will return ±∞ for a value outside the valid range for double.

Declaration
public static explicit operator double (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Double
| Improve this Doc View Source

Explicit(BigDecimal to Int16)

Explicit cast from BigDecimal to short.

Declaration
public static explicit operator short (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Int16
| Improve this Doc View Source

Explicit(BigDecimal to Int32)

Explicit cast from BigDecimal to int.

Declaration
public static explicit operator int (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Int32
| Improve this Doc View Source

Explicit(BigDecimal to Int64)

Explicit cast from BigDecimal to long.

Declaration
public static explicit operator long (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Int64
| Improve this Doc View Source

Explicit(BigDecimal to SByte)

Explicit cast from BigDecimal to sbyte.

Declaration
public static explicit operator sbyte (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.SByte
| Improve this Doc View Source

Explicit(BigDecimal to Single)

Explicit cast from BigDecimal to float.

(I implemented a method to do this using maths and bits, but it takes much longer.)

BigDecimal doesn't use a default precision for the "E" format specifier, so all digits will be rendered in the call to ToString(). This will produce the closest matching float possible.

This method will not throw an OverflowException, but will return ±∞ for a value outside the valid range for float.

Declaration
public static explicit operator float (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.Single
| Improve this Doc View Source

Explicit(BigDecimal to UInt16)

Explicit cast from BigDecimal to ushort.

Declaration
public static explicit operator ushort (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.UInt16
| Improve this Doc View Source

Explicit(BigDecimal to UInt32)

Explicit cast from BigDecimal to uint.

Declaration
public static explicit operator uint (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.UInt32
| Improve this Doc View Source

Explicit(BigDecimal to UInt64)

Explicit cast from BigDecimal to ulong.

Declaration
public static explicit operator ulong (BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
System.UInt64
| Improve this Doc View Source

Explicit(BigDecimal to UInt128)

Explicit cast from BigDecimal to UInt128.

Declaration
public static explicit operator UInt128(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
UInt128
| Improve this Doc View Source

GreaterThan(BigDecimal, BigDecimal)

Declaration
public static bool operator>(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GreaterThanOrEqual(BigDecimal, BigDecimal)

Declaration
public static bool operator >=(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Implicit(BigInteger to BigDecimal)

Implicit cast from BigInteger to BigDecimal.

Declaration
public static implicit operator BigDecimal(BigInteger n)
Parameters
Type Name Description
BigInteger n

The BigInteger value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(BigDecimal to BigRational)

Implicit cast from BigDecimal to BigRational.

This cast operation can be implicit because it can be done exactly, without loss of information, due to the use of BigIntegers inside BigRational.

Declaration
public static implicit operator BigRational(BigDecimal n)
Parameters
Type Name Description
BigDecimal n
Returns
Type Description
BigRational
| Improve this Doc View Source

Implicit(Half to BigDecimal)

Implicit cast from Half to BigDecimal.

NB: The resulting BigDecimal value is exactly the value encoded by the Half. However, since Halfs only approximate decimal values, it's possible that only the first few digits are valid in terms of the intended value. Therefore, you may need to use RoundSigFigs() to get the value you really want.

Declaration
public static implicit operator BigDecimal(Half n)
Parameters
Type Name Description
Half n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Implicit(Int128 to BigDecimal)

Implicit cast from Int128 to BigDecimal.

Declaration
public static implicit operator BigDecimal(Int128 n)
Parameters
Type Name Description
Int128 n

The Int128 value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(Byte to BigDecimal)

Implicit cast from byte to BigDecimal.

Declaration
public static implicit operator BigDecimal(byte n)
Parameters
Type Name Description
System.Byte n

The byte value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(Decimal to BigDecimal)

Implicit cast from decimal to BigDecimal.

The cast is implicit because any decimal value can be cast to a BigDecimal exactly, without loss of information. However, rounding off using Round() or RoundSigFigs() can cause information loss.

We don't need to use Parse() or division operations here, because the base is decimal. We can just extract the parts of the decimal from the bits and construct a BigDecimal from those. This method should be faster than using ToString() and Parse().

Declaration
public static implicit operator BigDecimal(decimal n)
Parameters
Type Name Description
System.Decimal n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Implicit(Double to BigDecimal)

Implicit cast from double to BigDecimal.

NB: The resulting BigDecimal value is exactly the value encoded by the double. However, since doubles only approximate decimal values, it's possible that only the first 15-17 digits are valid in terms of the intended value. Therefore, you may need to use RoundSigFigs() to get the value you really want, e.g.

BigDecimal bd = BigDecimal.RoundSigFigs(1.2345, DoubleMaxSigFigs);
Declaration
public static implicit operator BigDecimal(double n)
Parameters
Type Name Description
System.Double n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Implicit(Int16 to BigDecimal)

Implicit cast from short to BigDecimal.

Declaration
public static implicit operator BigDecimal(short n)
Parameters
Type Name Description
System.Int16 n

The short value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(Int32 to BigDecimal)

Implicit cast from int to BigDecimal.

Declaration
public static implicit operator BigDecimal(int n)
Parameters
Type Name Description
System.Int32 n

The int value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(Int64 to BigDecimal)

Implicit cast from long to BigDecimal.

Declaration
public static implicit operator BigDecimal(long n)
Parameters
Type Name Description
System.Int64 n

The long value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(SByte to BigDecimal)

Implicit cast from sbyte to BigDecimal.

Declaration
public static implicit operator BigDecimal(sbyte n)
Parameters
Type Name Description
System.SByte n

The sbyte value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(Single to BigDecimal)

Implicit cast from float to BigDecimal.

NB: The resulting BigDecimal value is exactly the value encoded by the float. However, since floats only approximate decimal values, it's possible that only the first 6-9 digits are valid in terms of the intended value. Therefore, you may need to use RoundSigFigs() to get the value you really want, e.g.

BigDecimal bd = BigDecimal.RoundSigFigs(1.2345f, FloatMaxSigFigs);
Declaration
public static implicit operator BigDecimal(float n)
Parameters
Type Name Description
System.Single n
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Implicit(UInt16 to BigDecimal)

Implicit cast from ushort to BigDecimal.

Declaration
public static implicit operator BigDecimal(ushort n)
Parameters
Type Name Description
System.UInt16 n

The ushort value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(UInt32 to BigDecimal)

Implicit cast from uint to BigDecimal.

Declaration
public static implicit operator BigDecimal(uint n)
Parameters
Type Name Description
System.UInt32 n

The uint value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(UInt64 to BigDecimal)

Implicit cast from ulong to BigDecimal.

Declaration
public static implicit operator BigDecimal(ulong n)
Parameters
Type Name Description
System.UInt64 n

The ulong value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Implicit(UInt128 to BigDecimal)

Implicit cast from UInt128 to BigDecimal.

Declaration
public static implicit operator BigDecimal(UInt128 n)
Parameters
Type Name Description
UInt128 n

The UInt128 value.

Returns
Type Description
BigDecimal

The equivalent BigDecimal value.

| Improve this Doc View Source

Increment(BigDecimal)

Declaration
public static BigDecimal operator ++(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Inequality(BigDecimal, BigDecimal)

Declaration
public static bool operator !=(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LessThan(BigDecimal, BigDecimal)

Declaration
public static bool operator <(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LessThanOrEqual(BigDecimal, BigDecimal)

Declaration
public static bool operator <=(BigDecimal x, BigDecimal y)
Parameters
Type Name Description
BigDecimal x
BigDecimal y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Modulus(BigDecimal, BigDecimal)

Declaration
public static BigDecimal operator %(BigDecimal a, BigDecimal b)
Parameters
Type Name Description
BigDecimal a
BigDecimal b
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Multiply(BigDecimal, BigDecimal)

Declaration
public static BigDecimal operator *(BigDecimal a, BigDecimal b)
Parameters
Type Name Description
BigDecimal a
BigDecimal b
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Subtraction(BigDecimal, BigDecimal)

Declaration
public static BigDecimal operator -(BigDecimal a, BigDecimal b)
Parameters
Type Name Description
BigDecimal a
BigDecimal b
Returns
Type Description
BigDecimal
| Improve this Doc View Source

UnaryNegation(BigDecimal)

Declaration
public static BigDecimal operator -(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigDecimal
| Improve this Doc View Source

UnaryPlus(BigDecimal)

Declaration
public static BigDecimal operator +(BigDecimal bd)
Parameters
Type Name Description
BigDecimal bd
Returns
Type Description
BigDecimal
| Improve this Doc View Source

Implements

IConvertible
IFloatingPoint<>
IPowerFunctions<>
IRootFunctions<>
IExponentialFunctions<>
ILogarithmicFunctions<>
ICloneable
ITrigonometricFunctions<>
IHyperbolicFunctions<>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX | Galaxy logo by Freepik