summaryrefslogtreecommitdiff
path: root/MLKFloat.h
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-16 11:02:11 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-16 11:02:11 +0200
commitcddf492efdf7e44b26a0093fced5673a78c2fd28 (patch)
treee0f9d4efe7676bbcfa3029b2969b87246823c9c8 /MLKFloat.h
parentce205cc7273a031ed6bbde71ba340a7996de6d5d (diff)
MLKFloat: Explicitly declare the contract for subclasses.
Diffstat (limited to 'MLKFloat.h')
-rw-r--r--MLKFloat.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/MLKFloat.h b/MLKFloat.h
index fe9ed48..bd8c3e4 100644
--- a/MLKFloat.h
+++ b/MLKFloat.h
@@ -20,7 +20,12 @@
#import <Foundation/NSString.h>
-
+// An MLKFloat can represent any kind of CL floating-point number.
+//
+// MLKFloat itself is not instantiable. It is a class cluster whose
+// instances are of one of its subclasses (currently MLKSingleFloat und
+// MLKDoubleFloat; an arbitrary-precision, GMP-backed type is planned
+// for the future).
@interface MLKFloat : MLKLispValue
+(MLKFloat *) floatWithExponentMarker:(unichar)exponentMarker
integerPart:(NSString *)intPart
@@ -28,4 +33,15 @@
fractionalPart:(NSString *)fractPart
exponent:(NSString *)exponent
exponentNegative:(BOOL)exponentNegative;
+
+// Abstract methods.
+-(float) floatValue;
+-(double) doubleValue;
+
+-(MLKFloat *) add:(MLKFloat *)arg;
+-(MLKFloat *) subtract:(MLKFloat *)arg;
+-(MLKFloat *) multiplyWith:(MLKFloat *)arg;
+-(MLKFloat *) divideBy:(MLKFloat *)arg;
+
+-(NSString *) description;
@end