Answer the question
In order to leave comments, you need to log in
How to round with negative precision?
There is a task in which it is required to write the round() function. There is an indication in the problem: "Notice that the precision can be negative, which means that the part before the decimal dot will be rounded".
Can you explain how rounding with negative precision works?
There is an example in the task: "my_round(123, -1) must return 120". And if the accuracy is -2, then what should be returned?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question