Compute the order of magnitude of an integer