If that doesn't help try float voltage = ((float) sensorVal/1024.0) * 5.0;
to type cast (force) sensorVal to be computed as a float.
If that doesn't help try float voltage = ((float) sensorVal/1024.0) * 5.0;
to type cast (force) sensorVal to be computed as a float.