Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import factorial
- from abc import ABC, abstractmethod
- class mathSolver( ABC ):
- @abstractmethod
- def compute( self, x ):
- pass
- class sinTaylor( mathSolver ):
- def compute(self, x):
- ans = 0
- persision = 10 # точность
- for k in range(0,persision,1):
- ans +=((-1)**k)*(x**(1+2*k))/factorial(1+2*k)
- return ans
- a = sinTaylor()
- print( a.compute(3.14) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement