Serial Monitor printing "Ovf" instead of number

Hello,

I have a program that will average the RPM of a bike wheel over the last 4 revolutions. I also have a function that is called if there is no activity for 2.5s and will make the average 0. The average is found by using storing the last four rpm values and averaging them! However the porgram often returns Ovf instead of the average value. Anyone know whats happening?

code ("!!!!" are put where relevant code is to this problem. Also serial monitor reading are below code.):

#include <Wire.h>

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
Wire.begin();
  setupMPU();
  for (int thisReading = 0; thisReading<numReadings; thisReading++){
  readings[thisReading]=0;
}
}

void setupMPU(){
  Wire.beginTransmission(0b1101000); //This is the I2C address of the MPU (b1101000/b1101001 for AC0 low/high datasheet sec. 9.2)
  Wire.write(0x6B); //Accessing the register 6B - Power Management (Sec. 4.28)
  Wire.write(0b00000000); //Setting SLEEP register to 0. (Required; see Note on p. 9)
  Wire.endTransmission();  
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x1C); //Accessing the register 1C - Acccelerometer Configuration (Sec. 4.5) 
  Wire.write(0b00000000); //Setting the accel to +/- 2g
  Wire.endTransmission(); 
}

void loop() {
  forceFunction();//get users force
  sendData();
}

void forceFunction()  {
  
  accelerometerReading(); 
 
  if (millis() - sleepTime <= 2400) {
  instance = millis() - wTime;       //instantenous time = current time - last time
  
  inputForceX = 500;                //random(500,1000);    //Gets xy force at specific time
  inputForceY = -500;               //random(100,400);

  
  //may make this a seperate function callable from two place
  resultantForce = sqrt(sq(inputForceX)+sq(inputForceY)); //resultant applied force **not effective forece**
  
  muArray[i] = atan(inputForceY/inputForceX) *57.2958;            //direction of the force vector
  
  instanceArray[i]=instance;                              //Stores time value
  
  forceArray[i]= abs(resultantForce);                     //Stores force at that specified time
                                         
  i=i+1;                                                  //increment for number of readings
}
else if (millis() - sleepTime > 2400 && millis()-pTime >500) {

  readingRPM3 = 0;    //if no activity for 2400 set rpm readings to zero!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  readingRPM2 = 0;
  readingRPM1 = 0; 
  readingRPM = 0;

  rpmAvg = (readingRPM + readingRPM1 + readingRPM2 + readingRPM3)/4;
  Serial.println(rpmAvg);
  
  total4 = total4 - AvF[n];
  AvF[n] = FeffTotal/i;
  total4 = total4 + AvF[n];
  BtAvF = total4/n;
  n = n+1;

 
 if (n >= 5) {
    n = 0;
  }
 i = 0;
 wTime = millis();
 pTime = millis();
}
}

void sendData(){  //send data via bluetooth
  
 if (millis() - dataSendTime >= 5000) {
  
  power = BtAvF * r * rpmAvg;
  //Serial.print(average);
  //Serial.println(rpmAvg);
  //Serial.print(BtAvF);

dataSendTime = 0;
}
}

void preProccessing() {
   
  w = (1000*6.282)/(2*revolutionTime);
  
  readingRPM3 = readingRPM2;
  readingRPM2 = readingRPM1;
  readingRPM1 = readingRPM; 
  readingRPM = abs(w*60/6.283); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  rpmAvg = (readingRPM + readingRPM1 + readingRPM2 + readingRPM3)/4;
 Serial.println(" 3, 2, 1, 0, Avg");
 Serial.print(readingRPM3);
 Serial.print(" , ");
 Serial.print(readingRPM2);
 Serial.print(" , ");
 Serial.print(readingRPM1);
 Serial.print(" , ");
 Serial.print(readingRPM);
 Serial.print(" , ");
 Serial.println(rpmAvg);
  //Ag = 9.81;
  //Ac = pow(w,2) * r;  
}

void dataProcessing () {
    for (j=0;j<i;j=j+1) {                             //total number of reading is i, this cycles through j, i number of times
    
    omega = (instanceArray[j] * 180 / revolutionTime)+ constant;    //crank angle @ each time step: time step (s) * 360 (deg) / time dor revolution (s)   
    alpha = 20.76 + 22.00*sin(omega + 190);              //comparative biomechanical study of circular.. redfield and hull
    theta = (omega + muArray[j] - 90 - alpha)/57.2958;        //finding angle for Feff *not complete*
    
    Feff = abs(forceArray[j] * cos(theta));
    FeffTotal = Feff + FeffTotal;
  } 
  
  total4 = total4 - AvF[n];
  AvF[n] = FeffTotal/i;
  total4 = total4 + AvF[n];
  BtAvF = total4/n;
  n = n+1;
  
  if (n >= 10) {
    n = 0;
  }
 FeffTotal = 0;
}

void accelerometerReading() {
 total2 = total2 - readings[readIndex];
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x3B); //Starting register for Accel Readings
  Wire.endTransmission();
  Wire.requestFrom(0b1101000,6); //Request Accel Registers (3B - 40)
  while(Wire.available() < 6);      
  accelX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
  accelY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY
  accelZ = Wire.read()<<8|Wire.read(); //Store last two bytes into accelZ
  gForceY = (accelY / 16384.0); 
  gForceZ = (accelZ / 16384.0);

  readings[readIndex] = (gForceY + gForceZ);

 
  total2 = total2 +readings[readIndex];

  readIndex = readIndex + 1;
  
  if (readIndex >=10){   //numReading
  readIndex = 0;
 }

average = total2/numReadings;

diff = 50*(average - average1)/ (millis()-oldTime);    //finding gradient
  oldTime = millis();

  
 switch (someValue) {
 case 1:
 if (average < average1 && average1 - average5 >0 && diff < -0.02 && average - trough > 0.2 && millis()-condTime >125) {
  
  counter = counter +1;
  revolutionTime = millis()-wTime;
  wTime = millis();
  condTime = millis();  
  
  if (millis()-sleepTime <2400){
  constant = 0;
  preProccessing();
 
  dataProcessing(); 
  }
  someValue = 2;
  i=0;
  peak = average;
  sleepTime = millis();
 }
 break;

case 2:
 if (average > average1 && average1 - average5 <0 && diff>0.02 && peak - average >0.2 && millis()-condTime > 125) {

  pop = pop+1;
  revolutionTime = millis()-wTime;
  wTime = millis();
  condTime = millis();  
     
 if (millis()-sleepTime <2400){ 
  constant = 180;
  preProccessing();
  dataProcessing();
 }
  i=0;
  someValue = 1;
  trough = average;
  sleepTime = millis();
 } 
break;
 } 
   //Serial.print(average);
   //Serial.print(",");
   //Serial.print(counter);
   //Serial.print(",");
   //Serial.println(pop);

  counter = 0;
  pop=0;
  average5 = average4;
  average4 = average3;
  average3= average2;
  average2= average1;
  average1 = average;
  delay(50);
  
  
}

Serial Monitor:

3, 2, 1, 0, Avg
0.00 , 0.00 , 0.00 , 53.37 , 13.34
3, 2, 1, 0, Avg
0.00 , 0.00 , 53.37 , 48.30 , 25.42
3, 2, 1, 0, Avg
0.00 , 53.37 , 48.30 , 57.91 , 39.89
3, 2, 1, 0, Avg
53.37 , 48.30 , 57.91 , 64.37 , 55.99
3, 2, 1, 0, Avg
48.30 , 57.91 , 64.13 , 58.02 , 57.09
3, 2, 1, 0, Avg
57.91 , 64.13 , ovf , 57.91 , ovf <------------------------error?
3, 2, 1, 0, Avg
64.13 , 15172.57 , 57.91 , 64.37 , 3839.74

I can tell just using my eyeballs and brain that the code you posted does not compile.

Would you like to try again with your actual code or would you prefer to hobble along with the fictitious code you posted?