Back to General discussions forum
В примере приведен результат деления на отрицательное число не соответствующий заданному условию округления.
In English "The example shows the result of dividing a negative number does not match the predetermined condition to rounding."
11 divided by -3 is -3.67, rounded to the nearest integer is -4.
11 делится на -3 -3,67, округляется до ближайшего целого числа -4.
Подтверждаю баг в 6-й задаче. Условия в задаче по округлению отрицательных чисел и пример не соответствует алгоритму проверки.
There is a bug in problem #6 with rounded rule.
There is no any bugs with the Problem 6
Initially I had thought the same but I double checked conditions on the Wikipedia
"However, the round half up tie-breaking rule is not symmetric, as the fractions that are exactly 0.5 always get rounded up. One reason for rounding up at 0.5 is that for positive decimals, only the first figure after the decimal point needs be examined. For example, when looking at 17.5000…, the "5" alone determines that the number should be rounded up, to 18 in this case. This is not true for negative decimals, such as −17.5000…, where all the fractional figures of the value need to be examined to determine if it should round to −17 (if it were −17.5000000) or to −18 (if it were −17.5000001 or lower)."
as result: -1.5 should be 1 -1.50000000000000000001 should be -2 -1.4999999999999999 should be -1