C# Класс Jurassic.BigInteger

Represents an arbitrarily large signed integer.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
One BigInteger
Zero BigInteger

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

Метод Описание
Abs ( BigInteger b ) : BigInteger

Gets the absolute value of a BigInteger object.

Add ( BigInteger left, BigInteger right ) : BigInteger

Adds two BigInteger values and returns the result.

BigInteger ( int value ) : System

Initializes a new instance of the BigInteger structure using a 32-bit signed integer value.

BigInteger ( long value ) : System

Initializes a new instance of the BigInteger structure using a 64-bit signed integer value.

Compare ( BigInteger a, BigInteger b ) : int

Returns -1 if a < b, 0 if they are the same, or 1 if a > b.

Equals ( object obj ) : bool

Returns a value that indicates whether the current instance and a specified BigInteger object have the same value.

FromDouble ( double value ) : BigInteger

Returns a new instance BigInteger structure from a 64-bit double precision floating point value.

GetHashCode ( ) : int

Returns the hash code for the current BigInteger object.

InPlaceDecrement ( ) : void

Decrements the current value of the BigInteger object.

LeftShift ( BigInteger value, int shift ) : BigInteger

Shifts a BigInteger value a specified number of bits to the left.

Log ( BigInteger value, double baseValue ) : double

Returns the logarithm of a specified number in a specified base.

Multiply ( BigInteger left, BigInteger right ) : BigInteger

Returns the product of two BigInteger values.

MultiplyAdd ( BigInteger b, int m, int a ) : BigInteger

Multiply by m and add a.

MultiplyPow5 ( BigInteger b, int k ) : BigInteger

Computes b x 5 ^ k.

Negate ( BigInteger value ) : BigInteger

Negates a specified BigInteger value.

Parse ( string str ) : BigInteger

Converts the string representation of a number to its BigInteger equivalent.

Pow ( int radix, int exponent ) : BigInteger

Equivalent to BigInteger.Pow but with integer arguments.

Quorem ( BigInteger &dividend, BigInteger divisor ) : int

Calculates the integer result of dividing dividend by divisor then sets dividend to the remainder.

RightShift ( BigInteger value, int shift ) : BigInteger

Shifts a BigInteger value a specified number of bits to the right.

Note: unlike System.Numerics.BigInteger, negative numbers are treated identically to positive numbers.

SetupQuorum ( BigInteger &dividend, BigInteger &divisor ) : void

Modifies the given values so they are suitable for passing to Quorem.

SetupQuorum ( BigInteger &dividend, BigInteger &divisor, BigInteger &other ) : void

Modifies the given values so they are suitable for passing to Quorem.

Subtract ( BigInteger left, BigInteger right ) : BigInteger

Subtracts one BigInteger value from another and returns the result.

ToDouble ( ) : double

Returns a double that corresponds to the BigInteger value.

ToString ( ) : string

Converts the numeric value of the current BigInteger object to its equivalent string representation.

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

Метод Описание
BigInteger ( uint bits, int wordCount, int sign ) : System
CountLeadingZeroBits ( uint value ) : int

Returns the number of leading zero bits in the given 32-bit integer.

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

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

Gets the absolute value of a BigInteger object.
public static Abs ( BigInteger b ) : BigInteger
b BigInteger A number.
Результат BigInteger

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

Adds two BigInteger values and returns the result.
public static Add ( BigInteger left, BigInteger right ) : BigInteger
left BigInteger The first value to add.
right BigInteger The second value to add.
Результат BigInteger

BigInteger() публичный Метод

Initializes a new instance of the BigInteger structure using a 32-bit signed integer value.
public BigInteger ( int value ) : System
value int A 32-bit signed integer.
Результат System

BigInteger() публичный Метод

Initializes a new instance of the BigInteger structure using a 64-bit signed integer value.
public BigInteger ( long value ) : System
value long A 64-bit signed integer.
Результат System

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

Returns -1 if a < b, 0 if they are the same, or 1 if a > b.
public static Compare ( BigInteger a, BigInteger b ) : int
a BigInteger
b BigInteger
Результат int

Equals() публичный Метод

Returns a value that indicates whether the current instance and a specified BigInteger object have the same value.
public Equals ( object obj ) : bool
obj object The object to compare.
Результат bool

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

Returns a new instance BigInteger structure from a 64-bit double precision floating point value.
public static FromDouble ( double value ) : BigInteger
value double A 64-bit double precision floating point value.
Результат BigInteger

GetHashCode() публичный Метод

Returns the hash code for the current BigInteger object.
public GetHashCode ( ) : int
Результат int

InPlaceDecrement() публичный Метод

Decrements the current value of the BigInteger object.
public InPlaceDecrement ( ) : void
Результат void

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

Shifts a BigInteger value a specified number of bits to the left.
public static LeftShift ( BigInteger value, int shift ) : BigInteger
value BigInteger The value whose bits are to be shifted.
shift int The number of bits to shift to the left. /// Can be negative to shift to the right.
Результат BigInteger

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

Returns the logarithm of a specified number in a specified base.
public static Log ( BigInteger value, double baseValue ) : double
value BigInteger A number whose logarithm is to be found.
baseValue double The base of the logarithm.
Результат double

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

Returns the product of two BigInteger values.
public static Multiply ( BigInteger left, BigInteger right ) : BigInteger
left BigInteger The first number to multiply.
right BigInteger The second number to multiply.
Результат BigInteger

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

Multiply by m and add a.
public static MultiplyAdd ( BigInteger b, int m, int a ) : BigInteger
b BigInteger
m int
a int
Результат BigInteger

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

Computes b x 5 ^ k.
public static MultiplyPow5 ( BigInteger b, int k ) : BigInteger
b BigInteger
k int
Результат BigInteger

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

Negates a specified BigInteger value.
public static Negate ( BigInteger value ) : BigInteger
value BigInteger The value to negate.
Результат BigInteger

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

Converts the string representation of a number to its BigInteger equivalent.
public static Parse ( string str ) : BigInteger
str string A string that contains the number to convert.
Результат BigInteger

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

Equivalent to BigInteger.Pow but with integer arguments.
public static Pow ( int radix, int exponent ) : BigInteger
radix int The number to be raised to a power.
exponent int The number that specifies the power.
Результат BigInteger

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

Calculates the integer result of dividing dividend by divisor then sets dividend to the remainder.
public static Quorem ( BigInteger &dividend, BigInteger divisor ) : int
dividend BigInteger The number that will be divided.
divisor BigInteger The number to divide by.
Результат int

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

Shifts a BigInteger value a specified number of bits to the right.
Note: unlike System.Numerics.BigInteger, negative numbers are treated identically to positive numbers.
public static RightShift ( BigInteger value, int shift ) : BigInteger
value BigInteger The value whose bits are to be shifted.
shift int The number of bits to shift to the right.
Результат BigInteger

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

Modifies the given values so they are suitable for passing to Quorem.
public static SetupQuorum ( BigInteger &dividend, BigInteger &divisor ) : void
dividend BigInteger The number that will be divided.
divisor BigInteger The number to divide by.
Результат void

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

Modifies the given values so they are suitable for passing to Quorem.
public static SetupQuorum ( BigInteger &dividend, BigInteger &divisor, BigInteger &other ) : void
dividend BigInteger The number that will be divided.
divisor BigInteger The number to divide by.
other BigInteger Another value involved in the division.
Результат void

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

Subtracts one BigInteger value from another and returns the result.
public static Subtract ( BigInteger left, BigInteger right ) : BigInteger
left BigInteger The value to subtract from.
right BigInteger The value to subtract.
Результат BigInteger

ToDouble() публичный Метод

Returns a double that corresponds to the BigInteger value.
public ToDouble ( ) : double
Результат double

ToString() публичный Метод

Converts the numeric value of the current BigInteger object to its equivalent string representation.
public ToString ( ) : string
Результат string

Описание свойств

One публичное статическое свойство

Gets a value that represents the number one (1).
public static BigInteger,Jurassic One
Результат BigInteger

Zero публичное статическое свойство

Gets a value that represents the number zero (0).
public static BigInteger,Jurassic Zero
Результат BigInteger