[Solved] Addition between Integer and Float…. resulting in a Zero
In the line: TimeNow = (28220 * 1000000) + (461189000 * 0.001); the (28220 * 1000000) part is calculated using ints, and (with 32-bit int) overflows giving an incorrect value (likely -1844771072). The (461189000 * 0.001) part is calculated using doubles, because of the 0.001 double constant, giving 461189.0 as a double. The two are … Read more