when integrating the sum values become larger and you might consider using unsigned longs for
volatile int NbTopsFan; //measuring the rising edges of the signal
An int wraps at 32767 pulses
An unsigned int at 65535
An unsigned long at 4 billion++ pulses
An unsigned long has 10 digits of precision where floats have around 7 d.o.p.