Fix when number's factor is negative

It must use the absolute value of factor to compute the digit shift using the
logarithm.

issue4031
review11361002
(grafted from 901f343723bf1a32640cc8cc7e1e1bbdc5332b9c)

--HG--
branch : 3.0
extra : source : 901f343723bf1a32640cc8cc7e1e1bbdc5332b9c