我在这里有一个程序可以求解数学方程:(3.31 * 10 到 -8 次方 + 2.01 * 10 到 -7 次方)/(7.16 * 10 到 -6 次方 + 2.01 * 10 到 -8 次方) ...但是,我的输出总是导致 nan!请告诉我原因并帮助我解决它。
int a = 10;
int b = -10;
//10 to the -8 power below
float ab = 1 / (a * b * b * b * b * b * b * b) ;
//10 to the -7 power below
float ba = 1 / (a * b * b * b * b * b * b) ;
//10 to the -6 power below
float abc = 1 / (a * b * b * b * b * b) ;
//equation below
double conclusion = (3.31 * ab + 2.01 * ba) / (7.16 * abc + 2.01 * ab);
NSLog(@"the answer to the equation is %f",conclusion);