企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
//一般数学统计 ~~~ NSArray *array = @[@"10", @"23", @"43", @"54", @"7", @"17", @"5"]; CGFloat sum = [[array valueForKeyPath:@"@sum.floatValue"] floatValue]; CGFloat avg = [[array valueForKeyPath:@"@avg.floatValue"] floatValue]; CGFloat max =[[array valueForKeyPath:@"@max.floatValue"] floatValue]; CGFloat min =[[array valueForKeyPath:@"@min.floatValue"] floatValue]; NSLog(@"sum==%f\navg==%f\nmax==%f\nmin==%f",sum,avg,max,min); return [NSString stringWithFormat:@"%f",sum]; ~~~