e12-table - replace resistors
The values in various part series have been decided by approximately evenly dividing a decade exponentially:

&gt;&gt;&gt; for i in range(0, 12):
...   print 10**(1+(i/12.))
... 
10.0
12.1152765863
14.6779926762
17.7827941004
21.5443469003
26.1015721568
31.6227766017
38.3118684956
46.4158883361
56.234132519
68.1292069058
82.5404185268


It is therefore feasible to take the log10 of a value, examine the fractional component, and drop it into one of the bins.