integer

Section: OATH Reference Manual (3O)
Updated: 26 August 1991
Index Return to Main Contents
 

NAME

integer (integerA, integerG) - an object that holds an integer value  

SYNOPSIS

#include <oath/numeric.h>  

DESCRIPTION

The integer is an object that holds an integer numeric value. Note that integer and the other numeric types in OATH are object-oriented like bag, as opposed to value-oriented like int or float -- see complex(3O).  

DERIVATION

integer : rational : real : complex : obj

integer is an abstract type.  

STATIC OPERATIONS

integerA integerA:: isa (objA)
integerA::isa(O) returns O if it is truly a integer; otherwise it returns Nil.
 

MEMBER OPERATIONS

int integerA:: hasEven ()
I.hasEven() returns TRUE if I is evenly divisible by 2.
int integerA:: hasOdd ()
I.hasOdd() returns TRUE if I is evenly divisible by 2.
int integerA:: hasLong ()
I.hasLong() returns TRUE if I is within the range of type long.
long integerA:: makeLong ()
I.makeLong() returns a long representing the value of I.
integerA integerA:: operator %= (integerA)
I1 %= I2 sets I1 to the remainder of the division of I1 / I2.
integerA integerA:: operator % (integerA)
I1 % I2 is the same as (+I1) %= I2.
integerA integerA:: remDivX (integerA, integerA)
I1.remDivX(I2, I3) sets I3 to I1/I2 and sets I1 to the remainder.
integerA integerA:: gcd (integerA)
I1.gcd(I2) sets I1 to the greatest common divisor of I1 and I2.
integerA integerA:: lcm (integerA)
I1.lcm(I2) sets I1 to the least common multiple of I1 and I2.
 

INTERNAL OPERATIONS

 

SEE ALSO

OATH(3O), complex(3O), real(3O), rational(3O), bigInteger(3O)  

AUTHOR

Brian M. Kennedy (Computer Science Center, Texas Instruments Incorporated)  

COPYRIGHT

Copyright (C) 1991 Texas Instruments Incorporated

Permission is granted to any individual or institution to use, copy, modify, and distribute this software, provided that this complete copyright and permission notice is maintained, intact, in all copies and supporting documentation. Texas Instruments Incorporated provides this software "as is" without express or implied warranty.  

BUGS

There is only one implementation of integer provided. Thus, all the difficulties in implementing cross-implementations of functionality may not be readily apparent. Thus, this interface may need augmentation to better support implementations. Planned implementations include bigInteger, dlongInteger, and longInteger.


 

Index

NAME
SYNOPSIS
DESCRIPTION
DERIVATION
STATIC OPERATIONS
MEMBER OPERATIONS
INTERNAL OPERATIONS
SEE ALSO
AUTHOR
COPYRIGHT
BUGS

This document was created by man2html, using the manual pages.
Time: 20:37:44 GMT, July 24, 2024