Problem 6 bug

Back to General discussions forum

KAIgnatov     2016-10-27 05:41:06

В примере приведен результат деления на отрицательное число не соответствующий заданному условию округления.

Quandray     2016-10-27 06:32:03
User avatar

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.

eldar_al     2017-02-24 16:19:20

Подтверждаю баг в 6-й задаче. Условия в задаче по округлению отрицательных чисел и пример не соответствует алгоритму проверки.

There is a bug in problem #6 with rounded rule.

Quandray     2017-02-25 08:14:55
User avatar

Please give an example. Пожалуйста, дайте пример

romkanax     2017-03-01 11:16:02

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

Please login and solve 5 problems to be able to post at forum