There is an implicit cast from int to float when dividing by fanout.  The cast should be made explicit.