C# Class BooRunner.Tools.DigitHelper

Contains big integer uint[] digits utilitary methods.
Afficher le fichier Open project: juanplopes/euler

Méthodes publiques

Méthode Description
DigitsBlockCopy ( uint blockFrom, uint blockTo, uint count ) : void

Copies digits from one block to another.

GetMinMaxLengthObjects ( BigInteger int1, BigInteger int2, BigInteger &smallerInt, BigInteger &biggerInt ) : void

Determines BigInteger object with lower length.

GetRealDigitsLength ( uint digits, uint length ) : uint

Returns real length of digits array (excluding leading zeroes).

SetBlockDigits ( double block, uint blockLength, double value ) : void

Sets digits in given block to given value.

SetBlockDigits ( uint block, uint blockLength, uint value ) : void

Sets digits in given block to given value.

ToUInt32WithSign ( int value, uint &resultValue, bool &negative ) : void

Converts int value to uint digit and value sign.

ToUInt64WithSign ( long value, ulong &resultValue, bool &negative ) : void

Converts long value to ulong digit and value sign.

Method Details

DigitsBlockCopy() public static méthode

Copies digits from one block to another.
public static DigitsBlockCopy ( uint blockFrom, uint blockTo, uint count ) : void
blockFrom uint From block start pointer.
blockTo uint To block start pointer.
count uint Count of dwords to copy.
Résultat void

GetMinMaxLengthObjects() public static méthode

Determines BigInteger object with lower length.
public static GetMinMaxLengthObjects ( BigInteger int1, BigInteger int2, BigInteger &smallerInt, BigInteger &biggerInt ) : void
int1 BigInteger First big integer.
int2 BigInteger Second big integer.
smallerInt BigInteger Resulting smaller big integer (by length only).
biggerInt BigInteger Resulting bigger big integer (by length only).
Résultat void

GetRealDigitsLength() public static méthode

Returns real length of digits array (excluding leading zeroes).
public static GetRealDigitsLength ( uint digits, uint length ) : uint
digits uint Big ingeter digits.
length uint Initial big integers length.
Résultat uint

SetBlockDigits() public static méthode

Sets digits in given block to given value.
public static SetBlockDigits ( double block, uint blockLength, double value ) : void
block double Block start pointer.
blockLength uint Block length.
value double Value to set.
Résultat void

SetBlockDigits() public static méthode

Sets digits in given block to given value.
public static SetBlockDigits ( uint block, uint blockLength, uint value ) : void
block uint Block start pointer.
blockLength uint Block length.
value uint Value to set.
Résultat void

ToUInt32WithSign() public static méthode

Converts int value to uint digit and value sign.
public static ToUInt32WithSign ( int value, uint &resultValue, bool &negative ) : void
value int Initial value.
resultValue uint Resulting unsigned part.
negative bool Resulting sign.
Résultat void

ToUInt64WithSign() public static méthode

Converts long value to ulong digit and value sign.
public static ToUInt64WithSign ( long value, ulong &resultValue, bool &negative ) : void
value long Initial value.
resultValue ulong Resulting unsigned part.
negative bool Resulting sign.
Résultat void