Most programming languages provide two different functions called floor and truncate to trim real numbers to integers. In these languages, floor(x) is defined exactly as we defined ⌊x⌋, and trunc(x) is defined to simply delete any digits that appear after the decimal point in writing x. So trunc(3.14159) = 3 .14159 = 3. Explain why programming languages have both floor and trunc—that is, explain under what circumstances floor(x) and trunc(x) give different values.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here