C# Класс Microsoft.Scripting.Utils.MathUtils

Показать файл Открыть проект

Открытые методы

Метод Описание
Abs ( this self ) : System.Numerics.BigInteger
Abs ( this self ) : double
AsInt32 ( this self, int &ret ) : bool
AsInt64 ( this self, long &ret ) : bool
BitLength ( BigInteger x ) : int
BitLength ( System.Numerics.BigInteger x ) : int
BitLength ( int x ) : int
BitLength ( long x ) : int
Conjugate ( this self ) : System.Numerics.Complex
Erf ( double v0 ) : double
ErfComplement ( double v0 ) : double
FloorDivideUnchecked ( int x, int y ) : int

Calculates the quotient of two 32-bit signed integers rounded towards negative infinity.

The caller must check for overflow (x = Int32.MinValue, y = -1)

FloorDivideUnchecked ( long x, long y ) : long

Calculates the quotient of two 32-bit signed integers rounded towards negative infinity.

The caller must check for overflow (x = Int64.MinValue, y = -1)

FloorRemainder ( int x, int y ) : int

Calculates the remainder of floor division of two 32-bit signed integers.

FloorRemainder ( long x, long y ) : long

Calculates the remainder of floor division of two 32-bit signed integers.

Gamma ( double v0 ) : double
GetBitCount ( this self ) : int
GetByteCount ( this self ) : int
GetRandBits ( this generator, int bits ) : BigInteger
GetRandBits ( this generator, int bits ) : System.Numerics.BigInteger
GetWordCount ( this self ) : int
Hypot ( double x, double y ) : double
Imaginary ( this self ) : double
IsNegative ( this self ) : bool
IsNegativeZero ( double self ) : bool
IsPositive ( this self ) : bool
IsZero ( this self ) : bool
Log ( this self ) : double
Log ( this self, double baseValue ) : double
Log10 ( this self ) : double
LogGamma ( double v0 ) : double
MakeComplex ( double real, double imag ) : Complex64
MakeComplex ( double real, double imag ) : System.Numerics.Complex
MakeImaginary ( double imag ) : Complex64
MakeImaginary ( double imag ) : System.Numerics.Complex
MakeReal ( double real ) : Complex64
MakeReal ( double real ) : System.Numerics.Complex
ModPow ( this self, System.Numerics.BigInteger power, System.Numerics.BigInteger mod ) : System.Numerics.BigInteger
ModPow ( this self, int power, System.Numerics.BigInteger mod ) : System.Numerics.BigInteger
Pow ( this self, Complex64 power ) : Complex64
Pow ( this self, System.Numerics.Complex power ) : System.Numerics.Complex
Power ( this self, int exp ) : System.Numerics.BigInteger
Random ( this generator, BigInteger limit ) : BigInteger
Random ( this generator, System.Numerics.BigInteger limit ) : System.Numerics.BigInteger
RoundAwayFromZero ( double value ) : double

Behaves like Math.Round(value, MidpointRounding.AwayFromZero) Needed because CoreCLR doesn't support this particular overload of Math.Round

RoundAwayFromZero ( double value, int precision ) : double

Behaves like Math.Round(value, precision, MidpointRounding.AwayFromZero) However, it works correctly on negative precisions and cases where precision is outside of the [-15, 15] range. (This function is also needed because CoreCLR lacks this overload.)

ToFloat64 ( this self ) : double
ToString ( this self, int radix ) : string
TryToFloat64 ( this self, double &result ) : bool

Приватные методы

Метод Описание
AbsSinPi ( double v0 ) : double

A numerically precise version of |sin(v0 * pi)|

AppendRadix ( uint rem, uint radix, char tmp, StringBuilder buf, bool leadingZeros, bool lowerCase ) : void
AsUInt32 ( this self, uint &ret ) : bool
AsUInt64 ( this self, ulong &ret ) : bool
BigIntegerToString ( uint d, int sign, int radix, bool lowerCase ) : string
BitLengthUnsigned ( uint x ) : int
BitLengthUnsigned ( ulong x ) : int
EvalPolynomial ( double v0, double coeffs ) : double

Evaluates a polynomial in v0 where the coefficients are ordered in increasing degree

EvalPolynomial ( double v0, double coeffs, bool reverse ) : double

Evaluates a polynomial in v0 where the coefficients are ordered in increasing degree if reverse is false, and increasing degree if reverse is true.

GammaRationalFunc ( double v0 ) : double

Take the quotient of the 2 polynomials forming the Lanczos approximation with N=13 and G=13.144565

GetHighestByte ( System.Numerics.BigInteger self, int &index, byte &byteArray ) : byte
GetPowerOf10 ( int precision ) : double
GetWord ( byte bytes, int start, int end ) : uint
GetWord ( this self, int index ) : uint
GetWords ( this self ) : uint[]
PositiveGamma ( double v0 ) : double

Computes the Gamma function on positive values, using the Lanczos approximation. Lanczos parameters are N=13 and G=13.144565.

PositiveLGamma ( double v0 ) : double

Computes the Log-Gamma function on positive values, using the Lanczos approximation. Lanczos parameters are N=13 and G=13.144565.

SinPi ( double v0 ) : double

A numerically precise version of sin(v0 * pi)

div ( uint n, int &nl, uint d ) : uint

Описание методов

Abs() публичный статический метод

public static Abs ( this self ) : System.Numerics.BigInteger
self this
Результат System.Numerics.BigInteger

Abs() публичный статический метод

public static Abs ( this self ) : double
self this
Результат double

AsInt32() публичный статический метод

public static AsInt32 ( this self, int &ret ) : bool
self this
ret int
Результат bool

AsInt64() публичный статический метод

public static AsInt64 ( this self, long &ret ) : bool
self this
ret long
Результат bool

BitLength() публичный статический метод

public static BitLength ( BigInteger x ) : int
x Microsoft.Scripting.Math.BigInteger
Результат int

BitLength() публичный статический метод

public static BitLength ( System.Numerics.BigInteger x ) : int
x System.Numerics.BigInteger
Результат int

BitLength() публичный статический метод

public static BitLength ( int x ) : int
x int
Результат int

BitLength() публичный статический метод

public static BitLength ( long x ) : int
x long
Результат int

Conjugate() публичный статический метод

public static Conjugate ( this self ) : System.Numerics.Complex
self this
Результат System.Numerics.Complex

Erf() публичный статический метод

public static Erf ( double v0 ) : double
v0 double
Результат double

ErfComplement() публичный статический метод

public static ErfComplement ( double v0 ) : double
v0 double
Результат double

FloorDivideUnchecked() публичный статический метод

Calculates the quotient of two 32-bit signed integers rounded towards negative infinity.
The caller must check for overflow (x = Int32.MinValue, y = -1)
is 0.
public static FloorDivideUnchecked ( int x, int y ) : int
x int Dividend.
y int Divisor.
Результат int

FloorDivideUnchecked() публичный статический метод

Calculates the quotient of two 32-bit signed integers rounded towards negative infinity.
The caller must check for overflow (x = Int64.MinValue, y = -1)
is 0.
public static FloorDivideUnchecked ( long x, long y ) : long
x long Dividend.
y long Divisor.
Результат long

FloorRemainder() публичный статический метод

Calculates the remainder of floor division of two 32-bit signed integers.
is 0.
public static FloorRemainder ( int x, int y ) : int
x int Dividend.
y int Divisor.
Результат int

FloorRemainder() публичный статический метод

Calculates the remainder of floor division of two 32-bit signed integers.
is 0.
public static FloorRemainder ( long x, long y ) : long
x long Dividend.
y long Divisor.
Результат long

Gamma() публичный статический метод

public static Gamma ( double v0 ) : double
v0 double
Результат double

GetBitCount() публичный статический метод

public static GetBitCount ( this self ) : int
self this
Результат int

GetByteCount() публичный статический метод

public static GetByteCount ( this self ) : int
self this
Результат int

GetRandBits() публичный статический метод

public static GetRandBits ( this generator, int bits ) : BigInteger
generator this
bits int
Результат Microsoft.Scripting.Math.BigInteger

GetRandBits() публичный статический метод

public static GetRandBits ( this generator, int bits ) : System.Numerics.BigInteger
generator this
bits int
Результат System.Numerics.BigInteger

GetWordCount() публичный статический метод

public static GetWordCount ( this self ) : int
self this
Результат int

Hypot() публичный статический метод

public static Hypot ( double x, double y ) : double
x double
y double
Результат double

Imaginary() публичный статический метод

public static Imaginary ( this self ) : double
self this
Результат double

IsNegative() публичный статический метод

public static IsNegative ( this self ) : bool
self this
Результат bool

IsNegativeZero() публичный статический метод

public static IsNegativeZero ( double self ) : bool
self double
Результат bool

IsPositive() публичный статический метод

public static IsPositive ( this self ) : bool
self this
Результат bool

IsZero() публичный статический метод

public static IsZero ( this self ) : bool
self this
Результат bool

Log() публичный статический метод

public static Log ( this self ) : double
self this
Результат double

Log() публичный статический метод

public static Log ( this self, double baseValue ) : double
self this
baseValue double
Результат double

Log10() публичный статический метод

public static Log10 ( this self ) : double
self this
Результат double

LogGamma() публичный статический метод

public static LogGamma ( double v0 ) : double
v0 double
Результат double

MakeComplex() публичный статический метод

public static MakeComplex ( double real, double imag ) : Complex64
real double
imag double
Результат Microsoft.Scripting.Math.Complex64

MakeComplex() публичный статический метод

public static MakeComplex ( double real, double imag ) : System.Numerics.Complex
real double
imag double
Результат System.Numerics.Complex

MakeImaginary() публичный статический метод

public static MakeImaginary ( double imag ) : Complex64
imag double
Результат Microsoft.Scripting.Math.Complex64

MakeImaginary() публичный статический метод

public static MakeImaginary ( double imag ) : System.Numerics.Complex
imag double
Результат System.Numerics.Complex

MakeReal() публичный статический метод

public static MakeReal ( double real ) : Complex64
real double
Результат Microsoft.Scripting.Math.Complex64

MakeReal() публичный статический метод

public static MakeReal ( double real ) : System.Numerics.Complex
real double
Результат System.Numerics.Complex

ModPow() публичный статический метод

public static ModPow ( this self, System.Numerics.BigInteger power, System.Numerics.BigInteger mod ) : System.Numerics.BigInteger
self this
power System.Numerics.BigInteger
mod System.Numerics.BigInteger
Результат System.Numerics.BigInteger

ModPow() публичный статический метод

public static ModPow ( this self, int power, System.Numerics.BigInteger mod ) : System.Numerics.BigInteger
self this
power int
mod System.Numerics.BigInteger
Результат System.Numerics.BigInteger

Pow() публичный статический метод

public static Pow ( this self, Complex64 power ) : Complex64
self this
power Microsoft.Scripting.Math.Complex64
Результат Microsoft.Scripting.Math.Complex64

Pow() публичный статический метод

public static Pow ( this self, System.Numerics.Complex power ) : System.Numerics.Complex
self this
power System.Numerics.Complex
Результат System.Numerics.Complex

Power() публичный статический метод

public static Power ( this self, int exp ) : System.Numerics.BigInteger
self this
exp int
Результат System.Numerics.BigInteger

Random() публичный статический метод

public static Random ( this generator, BigInteger limit ) : BigInteger
generator this
limit Microsoft.Scripting.Math.BigInteger
Результат Microsoft.Scripting.Math.BigInteger

Random() публичный статический метод

public static Random ( this generator, System.Numerics.BigInteger limit ) : System.Numerics.BigInteger
generator this
limit System.Numerics.BigInteger
Результат System.Numerics.BigInteger

RoundAwayFromZero() публичный статический метод

Behaves like Math.Round(value, MidpointRounding.AwayFromZero) Needed because CoreCLR doesn't support this particular overload of Math.Round
public static RoundAwayFromZero ( double value ) : double
value double
Результат double

RoundAwayFromZero() публичный статический метод

Behaves like Math.Round(value, precision, MidpointRounding.AwayFromZero) However, it works correctly on negative precisions and cases where precision is outside of the [-15, 15] range. (This function is also needed because CoreCLR lacks this overload.)
public static RoundAwayFromZero ( double value, int precision ) : double
value double
precision int
Результат double

ToFloat64() публичный статический метод

public static ToFloat64 ( this self ) : double
self this
Результат double

ToString() публичный статический метод

public static ToString ( this self, int radix ) : string
self this
radix int
Результат string

TryToFloat64() публичный статический метод

public static TryToFloat64 ( this self, double &result ) : bool
self this
result double
Результат bool