Fix #19: Integer calculations that cause an overflow are converted to doubles