iOS判断是否能够被整除

#pragma mark: - 判断是否能够被整除

-(BOOL)judgeStr:(NSString *)str1 with:(NSString *)str2
{
    
    int a = [str1 intValue];
    
    double s1 = [str2 doubleValue];
    
    int s2 = [str2 intValue];
    
    if (s1/a-s2/a>0) {
        
        return NO;
    }
    return YES;
}

你可能感兴趣的:(iOS判断是否能够被整除)