Let n be an integer and x a floating-point number. Explain the difference between n = x; and n = static_cast(x + 0.5); For what values of x do they give the same result? For what values of x do they give different results? What happens if x is negative?

Leave a Reply

Your email address will not be published. Required fields are marked *