BigInteger Class Reference
Public Member Functions | |
BigInteger (System.String value, int radix) | |
BigInteger (System.Int64 value) | |
BigInteger (System.String value) | |
BigInteger (byte[] value, int sign) | |
BigInteger () | |
override bool | Equals (System.Object value) |
virtual bool | Equals (long value) |
byte[] | GetData () |
override int | GetHashCode () |
void | Init (System.String val, int radix) |
bool | IsNegative () |
void | SecureDelete () |
void | SetData (byte[] ivalue) |
override System.String | ToString () |
System.String | ToString (int radix) |
Static Public Member Functions | |
static implicit | operator BigInteger (long value) |
Detailed Description
This class represents an ASN.1 INTEGER built-in type. In this case, the values can be greater than 64 bits in size. This class is used in generated source code if the <bigInteger> qualifier is specified in a compiler configuration file.
Constructor & Destructor Documentation
BigInteger | ( | ) |
The default constructor sets the big integer value object reference to null.
BigInteger | ( | byte[] | value, | |
int | sign | |||
) |
This constructor creates a new big integer object and sets it to the byte[] value passed in.
- Parameters:
-
value String value sign Can be -1 for negative, 0 for zero, or 1 for positive.
BigInteger | ( | System.String | value | ) |
This constructor creates a new big integer object and sets it to the string value passed in. String value may contain the prefix that describes the radix: 0x - hexadecimal, 0o - octal, 0b - binary. The string value without prefix assumes decimal value. The optional sign '-' may be specified at the beginning of the string to specify the negative value.
- Parameters:
-
value String value
BigInteger | ( | System.Int64 | value | ) |
This constructor creates a new big integer object and sets it to the int value passed in.
- Parameters:
-
value Integer value
BigInteger | ( | System.String | value, | |
int | radix | |||
) |
This constructor creates a new big integer object and sets it to the string value passed in. String value may contain the prefix that describes the radix: 0x - hexadecimal, 0o - octal, 0b - binary. The string value without prefix assumes decimal value. The optional sign '-' may be specified at the beginning of the string to specify the negative value.
- Parameters:
-
value String value radix Can be 16 for hexadecimal, 8 for octal, 2 for binary or 10 for decimal
Member Function Documentation
override bool Equals | ( | System.Object | value | ) |
This method compares this integer value to the given value for equality.
- Parameters:
-
value The Object to compare with the current Object. Object should be instance of BigInteger.
- Returns:
true
if the specified Object is equal to the current Object; otherwise,false
.
virtual bool Equals | ( | long | value | ) | [virtual] |
This method compares this integer value to the given value for equality.
- Parameters:
-
value The long value to compare with the current Object.
- Returns:
true
if the specified long value is equal to the current Object; otherwise,false
.
byte [] GetData | ( | ) |
This method provides the byte array representation of the integer value
- Returns:
- byte array for integer value
override int GetHashCode | ( | ) |
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
- Returns:
- A hash code for the current Object.
void Init | ( | System.String | val, | |
int | radix | |||
) |
Translates the String representation of a Integer in the specified radix into a BigInteger. The String representation consists of an optional minus sign followed by a sequence of one or more digits in the specified radix. The String may not contain any extraneous Characters (whitespace, for example).
- Parameters:
-
val String representation of Integer. radix radix to be used in interpreting string value.
- Exceptions:
-
System.FormatException val
is not a valid representation of a BigInteger in the specified radix, or invalid value of radix.
bool IsNegative | ( | ) |
This method checks the Integer value is negative.
- Returns:
true
if negative; otherwisefalse
static implicit operator BigInteger | ( | long | value | ) | [static] |
Overloaded implicit conversion operator for long to BigInteger value
void SecureDelete | ( | ) |
This function clears the current value (by overwritting with zeros). Than sets the value to zero, and passes the old value to garbage collector.
void SetData | ( | byte[] | ivalue | ) |
This method sets the Integer value from byte array.
- Parameters:
-
ivalue byte array of the integer value
- Returns:
- Decoded integer value
- See also:
- <seealso cref=GetData To retrieve Byte Array
override System.String ToString | ( | ) |
This method will return a string representation of the integer value. The format is the ASN.1 value format for this type..
- Returns:
- Stringified representation of the value
System.String ToString | ( | int | radix | ) |
Returns the String representation of this BigInteger in the given radix. If the radix is invalid, it will default to 10 (as is the case for Int32.ToString
). The a minus sign is prepended if appropriate. This method is compatible with BigInteger(String, int)
constructor.
- Parameters:
-
radix radix of the String representation.
- Returns:
- String representation of this BigInteger in the given radix.
- See also:
- <seealso cref=System.Int32.ToString Integer ToString methods