Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from decimal import *
  2.  
  3. getcontext().prec = 1024
  4.  
  5. ONE = Decimal(1)
  6. TWO = Decimal(2)
  7. FOUR = Decimal(4)
  8. HALF = Decimal(1/TWO)
  9.  
  10. a = ONE
  11. x = ONE
  12. b = TWO**(-HALF)
  13. c = ONE/FOUR
  14.  
  15. def circuit():
  16. global a, x, b, c
  17. print(((a+b)**TWO)/(FOUR*c))
  18. y = a
  19. a = (a + b) / TWO
  20. b = (b * y).sqrt()
  21. c = c - x * (a - y)**TWO
  22. x = TWO*x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement