# 这样可以的 from decimal import Decimal as D, getcontext getcontext().prec = 48 pi = D("3.141592653589793238462643383279") e = D("2.718281828459045235360287471352") result = e ** (pi * (163 ** D("0.5"))) "{:.13f}".format(result)