I am struggling to create a smart algorithm. Currently I have produced one which is super-ugly and not efficient because I am casting
strings back and forth, not really useful to share it here.
The point of algorithm is to get a number
10^x which is smaller than a given one.
- 600 => 100
- 34.54 => 10
- 7.2 => 1
- 0.123 => 0.1
I am sure I am missing something. Is there any smart way of doing that?