import decimal decimal.getcontext().prec = 70 for f in [3e-178, 1e-320, 3e-320, "1e-325", "3e-325"]: print("%s\t%s" % (f, decimal.Decimal(f).log10()))
Standard input is empty
3e-178 -177.5228787452803375835172220093158130425818111446701314507791687173572 1e-320 -320.0000048349480421542963791664378178773271498211156984605956663618384 3e-320 -319.5228835802283797170013512631827025681270209569250025957658007215332 1e-325 -325 3e-325 -324.5228787452803375627049720967448846907998711358093041351701343596948