In the function round of Display 3.6, which of these explains what happens in the body of the function? We reproduce the one line from the function body here:
```
return static_cast
```
a) This is overkill, it would be sufficient to use the floor function alone.
b) Adding 0.5 to number pushes the range up so floor can produce the correct rounding.
c) The static_cast
d) This is wrong. The argument for the floor function should be number-0.5.
b) Adding 0.5 to number pushes the range up so floor can produce the correct rounding., and c) The static_cast
Numbers between floor(number)+0.5 and floor(number)+1 should round to floor(number)+1. The expression number+0.5 pushes numbers in the range floor(number) and floor(number)+0.5 up so floor will produce the correct rounded number. It pushes numbers between floor(number) and floor(number)+0.5 to floor(number)+0.5 up but leaves them so that floor will produce the correct rounded value, namely floor(number).
You might also like to view...
Switches and ____ are the physical components that interconnect the computers within a network.
A. routers B. hubs C. firewalls D. proxies
A ________ is a pointing device that simulates using a pen on a tablet computer
A) mouse B) computer stick C) stylus D) digital writer
The methods for computing joins discussed in Section 10.5 all deal with equi-joins. Discuss their applicability to the problem of computing inequality joins, such as r daA
Suppose we use sort-merge join to compute inequality joins, such as r daA
?
?
Referring to the figure above, "Vacation" is chosen by default by using the ____ attribute.
A. chosen B. checked C. marked D. button