From 87aa70c58809187488603d360156bb5635637b14 Mon Sep 17 00:00:00 2001 From: "darpan.ka" Date: Mon, 25 Nov 2013 10:46:51 +0530 Subject: [PATCH] [Native][25/11/2013][Add]Adding BigInteger class Change-Id: I398d8903a2f2562e4f8ae7241aead849c8eb43a6 Signed-off-by: darpan.ka --- inc/FBaseBigInteger.h | 838 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 838 insertions(+) create mode 100644 inc/FBaseBigInteger.h diff --git a/inc/FBaseBigInteger.h b/inc/FBaseBigInteger.h new file mode 100644 index 0000000..395486e --- /dev/null +++ b/inc/FBaseBigInteger.h @@ -0,0 +1,838 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FBaseBigInteger.h + * @brief This is the header file for the %BigInteger class. + * + * @since 3.0 + * @final This class is not intended for extension. + * + * This header file contains the declarations of the %BigInteger class. + */ + +#ifndef _FBASE_BIG_INTEGER_H_ +#define _FBASE_BIG_INTEGER_H_ + +#include + + +namespace Tizen { namespace Base { namespace Collection +{ + class ArrayList; +}}} + + +namespace Tizen { namespace Base +{ +class ImmutableString; +class _BigIntegerImpl; +class BigInteger; + +class _OSP_EXPORT_ BigInteger + : public Object +{ +public: + enum PrimeNumberResult + { + DEFINITELY_COMPOSITE = 0, + PROBABLY_PRIME = 1, + DEFINITELY_PRIME = 2 + }; + + struct QuotientAndRemainder + { + BigInteger* quotient; + BigInteger* remainder; + }; + +public: + /** + * Initializes %BigInteger instance with a random value in the range 0 to 2^numBits - 1. + * + * @since 3.0 + * + * @param[in] numBits Number of bits + * + */ + explicit BigInteger(int numBits); + + /** + * Initializes %BigInteger instance with @signed @long @long value. + * + * @since 3.0 + * + * @param[in] value 64-bit @signed @long @long value + * + */ + explicit BigInteger(int64_t value); + + /** + * Initializes %BigInteger instance with null-terminated C string representing a numeric value. + * + * @since 3.0 + * + * @param[in] value Null-terminated C string representing a numeric value. + * + * @remarks -This method accepts only string representing integer value. Decimal separators are not allowed in the input string. + * -This method accepts binary, decimal, hexadecimal, and octal numbers given by the following grammar. + * + * @code + * + * Sign[opt] DecimalNumeral + * Sign[opt] 0b BinaryDigits + * Sign[opt] 0B BinaryDigits + * Sign[opt] 0 OctalDigits + * Sign[opt] 0x HexDigits + * Sign[opt] 0X HexDigits + * + * @endcode + * -The object is not fully constructed if the input string is not parseable. It sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * -The behavior of this constructor is not dependent on the system default locale setting. + * + * @exception E_SUCCESS The method is successful. + * @exception E_NUM_FORMAT The specified string does not represent valid binary, octal, decimal or hexadecimal number, or + * The specified string contains decimal separator which represent a floating point number. + */ + explicit BigInteger(const char* pStr); + + /** + * Initializes %BigInteger instance with null-terminated C string with given radix + * + * @since 3.0 + * + * @param[in] value Null-terminated C string representing a numeric value. + * @param[in] radix The radix of the string representing a numeric value @n + * Radix value range is from 2 to 36. + * + * @remarks -This method accepts only string representing integer value. Decimal separators are not allowed in the input string. + * + * Following examples explains the string representation for some of the radix + * + * @code + * + * BigInteger bigInt1("101010100", 2); // Radix 2 representation of decimal number 340 + * + * BigInteger bigInt2("20112", 3); // Radix 3 representation of decimal number 176 + * + * BigInteger bigInt3("1230321", 4); // Radix 4 representation of decimal number 6969 + * + * BigInteger bigInt4("4231034", 5); // Radix 5 representation of decimal number 70769 + * + * @endcode + * + * -The object is not fully constructed if the input string is not parseable. It sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * -The behavior of this constructor is not dependent on the system default locale setting. + * + * @exception E_SUCCESS The method is successful. + * @exception E_NUM_FORMAT The specified string does not represent valid binary, octal, decimal or hexadecimal number, or + * The specified string contains decimal separator which represent a floating point number. + * @exception E_OUT_OF_RANGE The specified radix is not in between 2 to 36. + */ + BigInteger(const char* pStr, int radix); + + /** + * Initializes %BigInteger instance with String representing a numeric value. + * + * @since 3.0 + * + * @param[in] value String representing a numeric value. + * + * @remarks -This method accepts only string representing integer value. Decimal separators are not allowed in the input string. + * -This method accepts decimal, hexadecimal, and octal numbers given by the following grammar. + * -The behavior of this constructor is not dependent on the system default locale setting. + * + * @code + * + * Sign[opt] DecimalNumeral + * Sign[opt] 0b BinaryDigits + * Sign[opt] 0B BinaryDigits + * Sign[opt] 0 OctalDigits + * Sign[opt] 0x HexDigits + * Sign[opt] 0X HexDigits + * + * @endcode + * + * -The object is not fully constructed if the input string is not parseable. It sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_NUM_FORMAT The specified string does not represent valid binary, octal, decimal or hexadecimal number, or + * The specified string contains decimal separator which represent a floating point number. + */ + explicit BigInteger(const ImmutableString& str); + + /** + * Initializes %BigInteger instance with String with given radix + * + * @since 3.0 + * + * @param[in] value String representing a numeric value. + * @param[in] radix The radix of the string representing a numeric value @n + * Radix value range is from 2 to 36. + * + * @remarks -This method accepts only string representing integer value. Decimal separators are not allowed in the input string. + * -The behavior of this constructor is not dependent on the system default locale setting. + * + * Following examples explains the string representation for some of the radix + * + * @code + * + * ImmutableString str1(L"CD14"); + * BigInteger bigInt1(str1, 16); // Radix 16 representation of decimal number 52500 + * + * ImmutableString str2(L"53214"); + * BigInteger bigInt2(str1, 6); // Radix 6 representation of decimal number 7210 + * + * ImmutableString str3(L"632456"); + * BigInteger bigInt3(str1, 7); // Radix 7 representation of decimal number 108968 + * + * ImmutableString str4(L"5746321"); + * BigInteger bigInt4(str1, 8); // Radix 8 representation of decimal number 1559761 + * + * @endcode + * + * -The object is not fully constructed if the input string is not parseable. It sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_NUM_FORMAT The specified string does not represent valid binary, octal, decimal or hexadecimal number, or + * The specified string contains decimal separator which represent a floating point number. + * @exception E_OUT_OF_RANGE The specified radix is not in between 2 to 36. + */ + BigInteger(const ImmutableString& str, int radix); + + /* + * Copying of objects using this copy constructor is allowed. + * + * @since 3.0 + * + * @param[in] value An instance of %BigInteger + */ + BigInteger(const BigInteger& bigInt); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 3.0 + * + * @remarks The internally allocated memory block is freed when the instance is destroyed. + */ + virtual ~BigInteger(); + + /** + * Calculates absolute value of the calling %BigInteger instance and returns a new %BigInteger instance containing absolute value. + * + * @since 3.0 + * + * @return New %BigInteger instance. + * + */ + BigInteger Absolute(void) const; + + /** + * Adds value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this + rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to add with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this + rhs value. + * + */ + BigInteger Add(const BigInteger& rhs) const; + + /** + * Performs binary And of value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this & rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to and with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this & rhs value. + * + */ + BigInteger And(const BigInteger& rhs) const; + + /** + * Performs binary complement of value of specified %BigInteger rhs instance and And'ed with value of calling %BigInteger instance + * and returns a new %BigInteger instance whose value is this & ~rhs. + * + * @since 3.0 + * + * @param[in] rhs Value is complemented and AND with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this & ~rhs value. + * + */ + BigInteger AndNot(const BigInteger& rhs) const; + + /** + * Clears bit at a specified position in the calling %BigInteger instance and returns a new %BigInteger instance. + * + * @since 3.0 + * + * @param[in] bitIndex Position where the bit has to be cleared. + * + * @return A new %BigInteger instance. + * + * @remarks -If the bitIndex is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bitIndex is less than 0 or grater than bit length of number in binary representation. + */ + BigInteger ClearBit(int bitIndex) const; + + /** + * Compares value of calling %BigInteger instance with value of specified %BigInteger instance. + * + * @since 3.0 + * + * @param[in] value Value to compare with calling %BigInteger instance.. + * + * @return Comparision value. + * @remarks + * 1 -If the calling %BigInteger instance value is greater than value + * 0 -If the calling %BigInteger instance value is equal to value + * -1 -If the calling %BigInteger instance value is less than value + * + */ + int CompareTo(const BigInteger& value) const; + + /** + * Divides value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this / rhs. + * + * @since 3.0 + * + * @param[in] rhs Divisor,value which divides the calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this / rhs value. + * + * @remarks -If the rhs represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified rhs represents number 0. + */ + BigInteger Divide(const BigInteger& rhs) const; + + /** + * Divides value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a struct QuotientAndRemainder containing the quotient and remainder. + * + * @since 3.0 + * + * @param[in] rhs Divisor,value which divides the calling %BigInteger instance. + * + * @return QuotientAndRemainder containing quotient and reminder. + * + * + * @remarks -If the rhs represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * - User should free the memory allocated to QuotientAndRemainder member variables + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified rhs represents number 0. + * + */ + QuotientAndRemainder DivideAndRemainderN(const BigInteger& rhs) const; + + /** + * Compares whether the value of the calling %BigInteger instance is equal to the specified object. + * + * @since 3.0 + * + * @param[in] obj An instance of object to compare. + * + * @return @c true if the values are equal else @c false + * + */ + bool Equals(const Object& obj) const; + + /** + * Flips bit at a specified position in the calling %BigInteger instance and returns a new %BigInteger instance. + * + * @since 3.0 + * + * @param[in] bitIndex Position where the bit is flipped. + * + * @return A new %BigInteger instance. + * + * @remarks -If the bitIndex is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bitIndex is less than 0 or grater than bit length of number in binary representation. + */ + BigInteger FlipBit(int bitIndex) const; + + /** + * Gets the number of bits set to 1 in the value of the calling %BigInteger instance. + * + * @since 3.0 + * + * @return Number of bits set to 1. + */ + int GetSetBitCount(void) const; + + /** + * Gets the number of bits in the binary representation value of the calling %BigInteger instance. + * + * @since 3.0 + * + * @return Number of bits in the binary representation value of %BigInteger instance. + */ + int GetBitLength(void) const; + + /** + * Gets the hash value of the calling %BigInteger instance. + * + * @since 3.0 + * + * @return The hash value of the current instance. + */ + int GetHashCode(void) const; + + /** + * Gets the lowest bit set value of the calling %BigInteger instance. + * + * @since 3.0 + * + * @return The position of the lowest bit set. + */ + int GetLowestSetBit(void) const; + + /** + * Gets the sign of the value of the calling %BigInteger instance. + * + * @since 3.0 + * + * @return The sign of the value. + * + * @remarks + * -1 -If the value < 0 + * 0 -If the value == 0 + * 1 -If the value > 0 + */ + int GetSign(void) const; + + /** + * Gets the greater common divisor of the value of calling %BigInteger instance and value of the specified %BigInteger instance + * and returns a new %BigInteger instance containing value of the greater common divisor. + * + * @since 3.0 + * + * @param[in] value Value with which the greater common divisor is computed + * + * @return A new %BigInteger instance containing value of greater common divisor. + * + * @remarks + * Zero is returned if the value of calling %BigInteger instance is 0 or value of the specified %BigInteger instance is 0 + * + */ + BigInteger GreaterCommonDivisor(const BigInteger& value) const; + + /** + * Checks whether the bit at specified index in the value of calling %BigInteger instance is set. + * + * @since 3.0 + * + * @param[in] bitIndex Position of the bit whose value is checked whether it is set. + * + * @return A new %BigInteger instance containing value of greater common divisor. + * + * @remarks -If the bitIndex is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bitIndex is less than 0 or grater than bit length of number in binary representation. + */ + bool IsBitSet(int bitIndex) const; + + /** + * Checks whether the value of calling %BigInteger instance is probably prime. + * + * @since 3.0 + * + * + * @return @c true if the value if prime else @c false + * + * @remarks + * -returns PROBABLY_PRIME if probably prime. + * -returns DEFINITELY_PRIME if definitely prime. + * -returns DEFINITELY_COMPOSITE if definitely composite. + */ + PrimeNumberResult IsProbablePrimeNumber(void) const; + + /** + * Finds the maximum between value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns new %BigInteger instance containing maximum value. + * + * @since 3.0 + * + * @param[in] rhs Value to compute the maximum with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing maximum value. + * + */ + BigInteger Maximum(const BigInteger& rhs) const; + + /** + * Finds the minimum between value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns new %BigInteger instance containing minimum value. + * + * @since 3.0 + * + * @param[in] rhs Value to compute the minimum with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing minimum value. + * + */ + BigInteger Minimum(const BigInteger& rhs) const; + + /** + * Performs modulus of value of the calling %BigInteger instance and value of specified %BigInteger instance + * and returns a new %BigInteger instance whose value is this mod value. + * + * @since 3.0 + * + * @param[in] value The modulas. + * + * @return A new %BigInteger instance containing this mod value. + * + * @remarks -If the value represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified value represents number 0 or number is negative. + * + * The modulus value must be positive. + * The result is always positive. + * + */ + BigInteger Modulus(const BigInteger& value) const; + + /** + * Performs 1 divided by of value of the calling %BigInteger instance and modulus with value of specified %BigInteger instance + * and returns a new %BigInteger instance whose value is 1/this mod value. + * + * @since 3.0 + * + * @param[in] value The modulus. + * + * @return A new %BigInteger instance containing 1/this mod value. + * + * @remarks -If the value represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified value represents number 0 or number is negative. + * + * The modulas value must be positive. + * The result is always positive. + * + */ + BigInteger ModulusInverse(const BigInteger& value) const; + + /** + * Calculates power of value of the calling %BigInteger instance and exponent specified in value of specified %BigInteger instance + * and the result is moded with value specified in the modulo %BigInteger instance. + * + * @since 3.0 + * + * @param[in] exponent The exponent. + * @param[in] modulo The modulas. + * + * @return A new %BigInteger instance containing pow(this, exponent) mod modulo. + * + * @remarks -If the modulo represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified modulo represents number 0 or modulo is negative. + */ + BigInteger ModulusPower(const BigInteger& exponent, const BigInteger& modulo) const; + + + /** + * Multiplies value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this * rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to multiply with calling %BigInteger instance. + * + * @return A new %BigInteger instance. + * + */ + + BigInteger Multiply(const BigInteger& rhs) const; + + /** + * Negates value of the calling %BigInteger instance and returns a new %BigInteger instance whose value is -this. + * + * @since 3.0 + * + * @return A new %BigInteger instance. + * + */ + BigInteger Negate(void) const; + + /** + * Gets the next probable prime number from the calling %BigInteger instance + * and returns a new %BigInteger instance which contains next probable prime number value is -this. + * + * @since 3.0 + * + * @return A new %BigInteger instance containing next probable prime number. + * + */ + BigInteger NextProbablePrimeNumber(void) const; + + + /** + * Complements, performs logical negation on each bit in the value of calling %BigInteger instance + * and returns a new %BigInteger instance which contains complement value. + * + * @since 3.0 + * + * @return A new %BigInteger instance containing complement value. + * + */ + BigInteger Not(void) const; + + /** + * Performs binary Or of value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this | rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to Or with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this | rhs. + * + */ + BigInteger Or(const BigInteger& rhs) const; + + /** + * Raises value of the calling %BigInteger instance to the power of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is pow(this, exponent). + * + * @since 3.0 + * + * @param[in] exponent Exponent value. + * + * @return A new %BigInteger instance containing pow(this, exponent) value. + * + * @remarks -If the exponent is negative it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified exponent value is negative. + */ + BigInteger Power(int exponent) const; + + /** + * Divides value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this % rhs. + * + * @since 3.0 + * + * @param[in] rhs Divisor,value which divides the calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this % rhs value. + * + * @remarks -If the divisor represents a number 0 it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified divisor represents number 0. + */ + BigInteger Remainder(const BigInteger& divisor) const; + + /** + * Sets bit at a specified position in the calling %BigInteger instance and returns a new %BigInteger instance. + * + * @since 3.0 + * + * @param[in] bitIndex Position where the bit has to be set. + * + * @return A new %BigInteger instance. + * + * @remarks -If the bitIndex is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bitIndex is less than 0 or grater than bit length of number in binary representation. + */ + BigInteger SetBit(int bitIndex) const; + + /** + * Performs Shift left of value of the calling %BigInteger instance with specified shift distance + * and returns a new %BigInteger instance whose value is this << shiftDistance. + * + * @since 3.0 + * + * @param[in] shiftDistance Shift distance. + * + * @return A new %BigInteger instance. + * + * @remarks -If the shiftDistance is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified shiftDistance is less than 0 or grater than bit length of number in binary representation. + */ + BigInteger ShiftLeft(int shiftDistance) const; + + /** + * Performs Shift right of value of the calling %BigInteger instance with specified shift distance + * and returns a new %BigInteger instance whose value is this >> shiftDistance. + * + * @since 3.0 + * + * @param[in] shiftDistance Shift distance. + * + * @return A new %BigInteger instance. + * + * @remarks -If the shiftDistance is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified shiftDistance is less than 0 or grater than bit length of number in binary representation. + */ + BigInteger ShiftRight(int shiftDistance) const; + + /** + * Subtracts value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this - rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to subtract with calling %BigInteger instance. + * + * @return A new %BigInteger instance. + * + */ + BigInteger Subtract(const BigInteger& rhs) const; + + /** + * Gets the @c double equivalent of the current instance of %BigInteger. + * + * @since 3.0 + * + * @return The @c double equivalent of the current instance + * + * @remarks -If the value is not in double range it sets the exception. + * -When exception occurs value is set to DBL_MAX if the number is grater than 0. + * -When exception occurs value is set to DBL_MIN if the number is less than 0. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The @cdouble value is not in between DBL_MAX and DBL_MIN range. + */ + double ToDouble(void) const; + + /** + * Gets the @c int64_t equivalent of the current instance of %BigInteger. + * + * @since 3.0 + * + * @return The @c int64_t equivalent of the current instance + * + * @remarks -If the value is not in long long range it sets the exception. + * -When exception occurs value is set to LongLong::VALUE_MAX if the number is grater than 0. + * -When exception occurs value is set to LongLong::VALUE_MIN if the number is less than 0. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The @cint64_t value is not in between LongLong::VALUE_MAX and LongLong::VALUE_MIN range. + */ + int64_t ToInt64(void) const; + + /** + * Converts value of the calling %BigInteger instance to string representation in decimal form. + * + * @since 3.0 + * + * @return String containing the value in decimal form. + * + */ + ImmutableString ToString(void) const; + + /** + * Converts value of the calling %BigInteger instance to string representation in specified radix. + * + * @since 3.0 + * + * @param[in] radix Radix used for the string representation. + * + * @return String containing the value in specified radix. + * + * @remarks -If radix is invalid it sets the exception. + * -GetLastResult() should be called to retrieve the last set exception + * + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified radix is not in between 2 to 36. + */ + ImmutableString ToString(int radix) const; + + /** + * Performs binary Xor of value of the calling %BigInteger instance with value of specified %BigInteger rhs instance + * and returns a new %BigInteger instance whose value is this ^ rhs. + * + * @since 3.0 + * + * @param[in] rhs Value to Xor with calling %BigInteger instance. + * + * @return A new %BigInteger instance containing this ^ rhs value. + * + */ + BigInteger Xor(const BigInteger& rhs) const; + + +private: + // + // This constructor is intentionally declared as private so that only the platform can create an instance. + // + // @param[in] bigInt An instance of %BigInteger class to copy from + // + BigInteger(); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + // @param[in] list An instance of %BigInteger + // + BigInteger& operator =(const BigInteger& bigInt); + + // + // Overloaded constructor + // + BigInteger(_BigIntegerImpl* pImpl); + +private: + friend class _BigIntegerImpl; + class _BigIntegerImpl* __pImpl; +}; +}} // Tizen::Base +#endif //_FBASE_BIG_INTEGER_H_ -- 2.7.4