为什么结果一直是0.5,while里面循环不起来

#include<stdio.h>
#include<math.h>
int main()
{
int a=1,b=2;
float term=0.5,s=0.0;
while(fabs(term)>1e-5)
{
s=s+term;
b=b+3;
a=-a;
term=a/b;
}
printf("结果是%f\n",s);
return 0;
}

a/b是两个整数相除,结果还是整数。改为term = a*1.0/b;

(float)a/(float)b

这样就对了