fork download
  1. from decimal import Decimal as D
  2.  
  3. for f in [3e-178, 1e-320, 3e-320, "1e-325", "3e-325"]:
  4. print("%s\t%s" % (f, D(f).log10()))
Success #stdin #stdout 0.14s 14624KB
stdin
Standard input is empty
stdout
3e-178	-177.5228787452803375835172220
1e-320	-320.0000048349480421542963792
3e-320	-319.5228835802283797170013513
1e-325	-325
3e-325	-324.5228787452803375627049721