問題文
A pricing sheet rounds the measurement 2.5 through the method of the Math class that returns the nearest mathematical integer as a double, and the stored figure reads 2.0 where the reviewer expected 3.0. What does the Math class say about that method, and why?
選択肢
- It settles a tie toward positive infinity for either sign, because rint carries the tie rule that Math.round applies and that rule reaches for the larger of the two mathematical integers in every case
- It settles a tie on the even one of the two neighbors, because rint takes over the tie rule of Math.round and that rule reaches for the integer whose lowest bit has been cleared by the binary format itself
- It settles a tie on the even one of the two neighbors, because the rule in the specification of rint reaches for the integer value that is even whenever two mathematical integers sit equally close to it in binary
- It settles a tie toward positive infinity for either sign, because the binary format resolves a tie in the hardware of the machine well before rint is handed the value that two mathematical integers neighbor