C# Class Granados.Mono.Math.BigInteger

Exibir arquivo Open project: poderosaproject/poderosa Class Usage Examples

Private Properties

Property Type Description
BigInteger System
BigInteger System
BigInteger System
BigInteger System
ClearBit void
Modulus uint
Normalize void
SetBit void
SetBit void
TestBit bool
ToString string
ToString string
operator bool
operator uint

Public Methods

Method Description
Add ( BigInteger bi1, BigInteger bi2 ) : BigInteger
BigInteger ( ) : System
BigInteger ( BigInteger bi ) : System
BigInteger ( byte inData ) : System
BitCount ( ) : int
Clear ( ) : void
Compare ( BigInteger bi ) : Sign
Divid ( BigInteger bi1, BigInteger bi2 ) : BigInteger
Divid ( BigInteger bi, int i ) : BigInteger
Equals ( object o ) : bool
GCD ( BigInteger bi ) : BigInteger
GeneratePseudoPrime ( int bits ) : BigInteger
GenerateRandom ( int bits ) : BigInteger

Generates a new, random BigInteger of the specified length using the default RNG crypto service provider.

GenerateRandom ( int bits, RandomNumberGenerator rng ) : BigInteger

Generates a new, random BigInteger of the specified length.

GetBytes ( ) : byte[]
GetHashCode ( ) : int
Incr2 ( ) : void

Increments this by two

IsProbablePrime ( ) : bool
LowestSetBit ( ) : int
ModInverse ( BigInteger modulus ) : BigInteger
ModPow ( BigInteger exp, BigInteger n ) : BigInteger
Modulus ( BigInteger bi1, BigInteger bi2 ) : BigInteger
Modulus ( BigInteger bi, int i ) : int
Multiply ( BigInteger bi1, BigInteger bi2 ) : BigInteger
Multiply ( BigInteger bi, int i ) : BigInteger
NextHighestPrime ( BigInteger bi ) : BigInteger

Generates the smallest prime >= bi

Parse ( string number ) : BigInteger
Randomize ( ) : void

Randomizes the bits in "this" from the default RNG.

Randomize ( RandomNumberGenerator rng ) : void

Randomizes the bits in "this" from the specified RNG.

Subtract ( BigInteger bi1, BigInteger bi2 ) : BigInteger
TestBit ( int bitNum ) : bool
ToString ( ) : string
operator ( ) : BigInteger
operator ( ) : int

Private Methods

Method Description
BigInteger ( BigInteger bi, uint len ) : System
BigInteger ( Sign sign, uint len ) : System
BigInteger ( uint inData ) : System
BigInteger ( ulong ul ) : System
ClearBit ( uint bitNum ) : void
Modulus ( BigInteger bi, uint ui ) : uint
Normalize ( ) : void

Normalizes this by setting the length to the actual number of uints used in data and by setting the sign to Sign.Zero if the value of this is 0.

SetBit ( uint bitNum ) : void
SetBit ( uint bitNum, bool value ) : void
TestBit ( uint bitNum ) : bool
ToString ( uint radix ) : string
ToString ( uint radix, string characterSet ) : string
operator ( ) : bool
operator ( ) : uint

Method Details

Add() public static method

public static Add ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger
bi2 BigInteger
return BigInteger

BigInteger() public method

public BigInteger ( ) : System
return System

BigInteger() public method

public BigInteger ( BigInteger bi ) : System
bi BigInteger
return System

BigInteger() public method

public BigInteger ( byte inData ) : System
inData byte
return System

BitCount() public method

public BitCount ( ) : int
return int

Clear() public method

public Clear ( ) : void
return void

Compare() public method

public Compare ( BigInteger bi ) : Sign
bi BigInteger
return Sign

Divid() public static method

public static Divid ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger
bi2 BigInteger
return BigInteger

Divid() public static method

public static Divid ( BigInteger bi, int i ) : BigInteger
bi BigInteger
i int
return BigInteger

Equals() public method

public Equals ( object o ) : bool
o object
return bool

GCD() public method

public GCD ( BigInteger bi ) : BigInteger
bi BigInteger
return BigInteger

GeneratePseudoPrime() public static method

public static GeneratePseudoPrime ( int bits ) : BigInteger
bits int
return BigInteger

GenerateRandom() public static method

Generates a new, random BigInteger of the specified length using the default RNG crypto service provider.
public static GenerateRandom ( int bits ) : BigInteger
bits int The number of bits for the new number.
return BigInteger

GenerateRandom() public static method

Generates a new, random BigInteger of the specified length.
public static GenerateRandom ( int bits, RandomNumberGenerator rng ) : BigInteger
bits int The number of bits for the new number.
rng System.Security.Cryptography.RandomNumberGenerator A random number generator to use to obtain the bits.
return BigInteger

GetBytes() public method

public GetBytes ( ) : byte[]
return byte[]

GetHashCode() public method

public GetHashCode ( ) : int
return int

Incr2() public method

Increments this by two
public Incr2 ( ) : void
return void

IsProbablePrime() public method

public IsProbablePrime ( ) : bool
return bool

LowestSetBit() public method

public LowestSetBit ( ) : int
return int

ModInverse() public method

public ModInverse ( BigInteger modulus ) : BigInteger
modulus BigInteger
return BigInteger

ModPow() public method

public ModPow ( BigInteger exp, BigInteger n ) : BigInteger
exp BigInteger
n BigInteger
return BigInteger

Modulus() public static method

public static Modulus ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger
bi2 BigInteger
return BigInteger

Modulus() public static method

public static Modulus ( BigInteger bi, int i ) : int
bi BigInteger
i int
return int

Multiply() public static method

public static Multiply ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger
bi2 BigInteger
return BigInteger

Multiply() public static method

public static Multiply ( BigInteger bi, int i ) : BigInteger
bi BigInteger
i int
return BigInteger

NextHighestPrime() public static method

Generates the smallest prime >= bi
public static NextHighestPrime ( BigInteger bi ) : BigInteger
bi BigInteger A BigInteger
return BigInteger

Parse() public static method

public static Parse ( string number ) : BigInteger
number string
return BigInteger

Randomize() public method

Randomizes the bits in "this" from the default RNG.
public Randomize ( ) : void
return void

Randomize() public method

Randomizes the bits in "this" from the specified RNG.
public Randomize ( RandomNumberGenerator rng ) : void
rng System.Security.Cryptography.RandomNumberGenerator A RNG.
return void

Subtract() public static method

public static Subtract ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger
bi2 BigInteger
return BigInteger

TestBit() public method

public TestBit ( int bitNum ) : bool
bitNum int
return bool

ToString() public method

public ToString ( ) : string
return string

operator() public static method

public static operator ( ) : BigInteger
return BigInteger

operator() public static method

public static operator ( ) : int
return int