summaryrefslogtreecommitdiff
path: root/MLKSingleFloat.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKSingleFloat.m')
-rw-r--r--MLKSingleFloat.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/MLKSingleFloat.m b/MLKSingleFloat.m
index 9c2902f..1d3f957 100644
--- a/MLKSingleFloat.m
+++ b/MLKSingleFloat.m
@@ -126,6 +126,22 @@
return [MLKSingleFloat singleFloatWithFloat:(value / [(MLKFloat*)arg floatValue])];
}
+-(NSComparisonResult) compare:(MLKSingleFloat *)arg
+{
+ if (self->value == arg->value)
+ return NSOrderedSame;
+ else if (self->value < arg->value)
+ return NSOrderedAscending;
+ else
+ return NSOrderedDescending;
+}
+
+-(BOOL) isEqual:(id)arg
+{
+ return ([arg isKindOfClass:[MLKSingleFloat class]]
+ && self->value == ((MLKSingleFloat *)arg)->value);
+}
+
-(NSString *) description
{
NSString *str = [NSString stringWithFormat:@"%e", value];