diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-15 22:09:13 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-15 22:09:13 +0200 |
commit | 47da9c1e9ac25b3248a808f4519e2c64ecb8e2b4 (patch) | |
tree | 8a237a5a18e7b91a2c83473bd6b0a9db381daab0 /MLKInteger.h | |
parent | c2efa347a8e5f1d83427c34defa953e594a2bb12 (diff) |
Add class MLKInteger.
Diffstat (limited to 'MLKInteger.h')
-rw-r--r-- | MLKInteger.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/MLKInteger.h b/MLKInteger.h index 38d319e..57687b4 100644 --- a/MLKInteger.h +++ b/MLKInteger.h @@ -18,18 +18,37 @@ #import "MLKLispValue.h" +#include <stdarg.h> +#include <stdio.h> +#include <gmp.h> + @class NSString; @interface MLKInteger : MLKLispValue { + mpz_t value; } +-(MLKInteger *) initWithMPZ:(mpz_t)mpz; +-(MLKInteger *) initWithString:(NSString *)string + negative:(BOOL)negative + base:(unsigned int)base; + ++(MLKInteger *) integerWithMPZ:(mpz_t)mpz; +(MLKInteger *) integerWithString:(NSString *)string negative:(BOOL)negative base:(unsigned int)base; -(int) intValue; +-(MLKInteger *) add:(MLKInteger *)arg; +-(MLKInteger *) subtract:(MLKInteger *)arg; +-(MLKInteger *) multiplyWith:(MLKInteger *)arg; +-(MLKInteger *) divideBy:(MLKInteger *)arg; + +-(NSString *) description; +-(NSString *) descriptionWithBase:(int)base; + -(void) dealloc; @end |