summaryrefslogtreecommitdiff
path: root/MLKSingleFloat.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-07-06 23:53:04 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-07-06 23:53:04 +0200
commit26a11662d6d371a1d0c44de6bb028a1523ba4dc5 (patch)
tree9532f796a01ba5b3000d3e5bd6062c59f2a934b6 /MLKSingleFloat.m
parentbb79a71e7aa85536d3d60d50913d5fc39c4ac07b (diff)
Add class MLKNumber, unify arithmetic interface.
Diffstat (limited to 'MLKSingleFloat.m')
-rw-r--r--MLKSingleFloat.m24
1 files changed, 12 insertions, 12 deletions
diff --git a/MLKSingleFloat.m b/MLKSingleFloat.m
index c10ccce..9c2902f 100644
--- a/MLKSingleFloat.m
+++ b/MLKSingleFloat.m
@@ -94,36 +94,36 @@
return value;
}
--(MLKFloat *) add:(MLKFloat *)arg
+-(MLKNumber *) add:(MLKNumber *)arg
{
if ([arg isKindOfClass:[MLKDoubleFloat class]])
- return [MLKDoubleFloat doubleFloatWithDouble:(value + [arg doubleValue])];
+ return [MLKDoubleFloat doubleFloatWithDouble:(value + [(MLKFloat*)arg doubleValue])];
else
- return [MLKSingleFloat singleFloatWithFloat:(value + [arg floatValue])];
+ return [MLKSingleFloat singleFloatWithFloat:(value + [(MLKFloat*)arg floatValue])];
}
--(MLKFloat *) subtract:(MLKFloat *)arg
+-(MLKNumber *) subtract:(MLKNumber *)arg
{
if ([arg isKindOfClass:[MLKDoubleFloat class]])
- return [MLKDoubleFloat doubleFloatWithDouble:(value - [arg doubleValue])];
+ return [MLKDoubleFloat doubleFloatWithDouble:(value - [(MLKFloat*)arg doubleValue])];
else
- return [MLKSingleFloat singleFloatWithFloat:(value - [arg floatValue])];
+ return [MLKSingleFloat singleFloatWithFloat:(value - [(MLKFloat*)arg floatValue])];
}
--(MLKFloat *) multiplyWith:(MLKFloat *)arg
+-(MLKNumber *) multiplyWith:(MLKNumber *)arg
{
if ([arg isKindOfClass:[MLKDoubleFloat class]])
- return [MLKDoubleFloat doubleFloatWithDouble:(value * [arg doubleValue])];
+ return [MLKDoubleFloat doubleFloatWithDouble:(value * [(MLKFloat*)arg doubleValue])];
else
- return [MLKSingleFloat singleFloatWithFloat:(value * [arg floatValue])];
+ return [MLKSingleFloat singleFloatWithFloat:(value * [(MLKFloat*)arg floatValue])];
}
--(MLKFloat *) divideBy:(MLKFloat *)arg
+-(MLKNumber *) divideBy:(MLKNumber *)arg
{
if ([arg isKindOfClass:[MLKDoubleFloat class]])
- return [MLKDoubleFloat doubleFloatWithDouble:(value / [arg doubleValue])];
+ return [MLKDoubleFloat doubleFloatWithDouble:(value / [(MLKFloat*)arg doubleValue])];
else
- return [MLKSingleFloat singleFloatWithFloat:(value / [arg floatValue])];
+ return [MLKSingleFloat singleFloatWithFloat:(value / [(MLKFloat*)arg floatValue])];
}
-(NSString *) description