//绝对值
float count = 1.2;
//NSLog(@"===%.9f",count);//1.200000048
//fabs(count-1.2)求的是绝对值
if(fabs(count-1.2) < 0.000001) {
//在范围之内如果条件成立说明是1.2
//NSLog(@" =%.9f",count);
}
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
//可以是当前类,可以是父类
if([btn isKindOfClass:[UIView class]]) {
NSLog(@"is class");
} else {
NSLog(@"no class");
}
//判断是否是当前类,只能是当前类
if([btn isMemberOfClass:[UIView class]]) {
NSLog(@"is menber");
} else {
NSLog(@"no menber");
}