Computer Algebra Kit (c) 1992,00 by Comp.Alg.Objects. All Rights Reserved.

**Maturity Index:** Relatively mature

- asNumerical
- asModp:
- digitValue
- digitValue:
- ulongValue
- ulongValue:
- intValue
- intValue:
- doubleValue
- floatValue

+Returns a new integer equal to zero. The instance methodnew

**See also:** - zero

+Returns a new integer from the decimal representationstr:(STR)aString

+Returns a new integer with value equal toint:(int)intValue

+Returns a new integer object that is thefactorial:(int)n

+Returns a new object that is thefibonacci:(int)n

-Makes a copy of the digits.copy

-For integer objects, deepCopy is equivalent todeepCopy

-Frees the array of digits of the integer object.release

- (int)Returns the number of DIGIT's in the integer. Returns zero if the integer is zero. The leading digit of an integer is at position numDigits minus one.numDigits

- (BOOL)Whether the integer consists of a single digit. If the integer is zero, this method returns NO. The method ignores the sign of the integer.isDigit

**See also:** digitValue

-InsertsinsertDigit:(DIGIT)d

- (DIGIT)Removes and returns the last digit, shifting the other digits one position down. The method returns zero if the integer is equal to zero.removeDigit

- (DIGIT)Returns the digit at positiondigitAt:(int)i

- (DIGIT)Returns the least significant digit of the integer, the digit at position 0. Returns 0 if the integer is zero.lastDigit

- (DIGIT)Returns the most significant digit of the integer, the digit at position numDigits minus one. The leading digit of a nonzero integer is never zero. The method returns 0 if the integer is zero.leadingDigit

- (STR)Returns the decimal representation of the integer as a NULL-terminated string of characters. The string is automatically disposed off when freeing the integer, or when modifying the integer with methods that work destructively on the integer such asstr

-Returns a new integer from the decimal representationstr:(STR)aString

-Returns a new instance of theasNumerical

**See also:** floatValue

-Returns a new instance of theasModp:(unsigned short)p

**See also:** IntegerModp

- (DIGIT)Equivalent todigitValue

-Returns a new (positive) integer object, with value equal todigitValue:(DIGIT)aValue

- (unsigned long)Returns the two last digits of the integer as anulongValue

-Returns a (positive) integer with value asulongValue:(unsigned long)aValue

- (int)Returns the value of the integer asintValue

-Returns a new integer with value equal tointValue:(int)aValue

- (double)Returns the integer as a floating-pointdoubleValue

- (float)Returns the integer as a floating-pointfloatValue

-Returns a copy of a shared integer instance with value equal to zero.zero

-Returns a new integer that is the sum of the integeraddDigit:(DIGIT)d

-Returns a new integer that is the equal to the integersubtractDigit:(DIGIT)d

-Returns a copy of a shared integer instance with value equal to one.one

-Returns a copy of the integer minus one.minusOne

-Returns the product of the integer and the digitmultiplyDigit:(DIGIT)d

-Returnsinverse

-Returns the exact quotient on division bydivide:b

**See also:** quotient:

-Returns the exact quotient on division by the digitdivideDigit:(DIGIT)b

-Returns the quotient on division by the digitquotientDigit:(DIGIT)b

-Returns the remainder and, if a non-NULL pointer is passed forremainder:bquotient:(id *)q

-Returns the quotient and, if a non-NULL pointer is passed along forquotientDigit:(DIGIT)dremainder:(DIGIT *)r

- (DIGIT)Returns theremainderDigit:(DIGIT)d

- (BOOL)Whether the integer is even i.e., zero or divisible by two.isEven

- (BOOL)Whether the integer is odd i.e., not divisible by two.isOdd

-Returns a new (non-negative) integer, the greatest common divisor of the two integers, computed by the Euclidean algorithm.gcd:b

- (BOOL)Returns YES if the integer is negative.printsLeadingSign

-Prints the integer in decimal representation toprintOn:(IOD)aFile