iOS float类型比较大小

NSNumber *a=[NSNumber numberWithFloat:81.9];
NSNumber *b=[NSNumber numberWithFloat:311.15];

if ([a compare:b]==NSOrderedAscending) {
  NSLog(@"a小于b");
}
原文地址:https://www.cnblogs.com/kw-ios/p/3480255.html