fork download
  1. #log10(log10((2^((2^(115-1))-1))*(2-(2^-4294967180))))
  2. from decimal import *
  3. getcontext().prec = 100
  4. from decimal import localcontext
  5. with localcontext() as ctx:
  6. print(ctx.Emax) # デフォルトの指数上限は999999なので、今回の計算だと足りない
  7. ctx.Emax = 999999999999999999999999999999999999 # 指数上限を増やす
  8. s = ctx.power(2,20769187434139310514121985316880383)
  9. print(s)
  10. w = ctx.power(2,-4294967180)
  11. print(w)
  12. t = (s * 2 - s * w)
  13. print(t)
  14. x = t.log10()
  15. print(x)
  16. y = x.log10()
  17. print(y)
  18.  
Success #stdin #stdout 0.06s 66084KB
stdin
Standard input is empty
stdout
999999999
6.846194358963926965312086138303944981275886936062751606916428004850139865061346646920761047717292454E+6252148403243369369507575027472120
0E-1000000098
1.369238871792785393062417227660788996255177387212550321383285600970027973012269329384152209543458491E+6252148403243369369507575027472121
6252148403243369369507575027472121.136479219976118776872467927501539848697645392075172640016007760340
33.79602927803953145109997858464656262695562002580878769896892674125907270351639335872189806561303658