Let e and n be integers such that 10**f <= n < 10**(f+1) and for which the exact mathematical value of n * 10**(e-f) - x is as close to zero as possible. If there are two such sets of e and n, pick the e and n for which n * 10**(e-f) is larger.
See Implementation
Let e and n be integers such that 10**f <= n < 10**(f+1) and for which the exact mathematical value of n * 10**(e-f) - x is as close to zero as possible. If there are two such sets of e and n, pick the e and n for which n * 10**(e-f) is larger.