Weird glitch with my program

When I run this code for a small volt meter, It always shows inf or nan on my serial monitor.
The code:

float input_voltage = 0.0;
float temp=0.0;

void setup()
{
   Serial.begin(9600);
}
void loop()
{
    input_voltage = (analogRead(A0) * 5.0) / 1024.0; 
   if ((temp-0.01) > input_voltage || (temp+0.01) < input_voltage && !(input_voltage == 0)) {
    Serial.print("v= ");
    Serial.println(input_voltage/(4700/(4700+10000)));
   }
   temp = input_voltage;
    delay(10);
}
Serial.println(input_voltage/(4700.0/(4700.0+10000.0)));

That part inside the parenthesis was being done with integer math. So it turned into a divide by zero situation.