int to double cast bug