fix compiler warning casting float