Lines Matching defs:sqrt
61 >>> print(dig.sqrt())
63 >>> print(Decimal(3).sqrt())
239 sqrt(-x) , x > 0
2727 def sqrt(self, context=None):
2741 # exponent = self._exp // 2. sqrt(-0) = -0
2746 return context._raise_error(InvalidOperation, 'sqrt(-x), x > 0')
2752 # (exact) square root of self is sqrt(c)*10**e, and 10**(p-1)
2753 # <= sqrt(c) < 10**p, so the closest representable Decimal at
2754 # precision p is n*10**e where n = round_half_even(sqrt(c)),
2755 # the closest integer to sqrt(c) with the even integer chosen
2793 # find n = floor(sqrt(c)) using Newton's method
5475 def sqrt(self, a):
5481 >>> ExtendedContext.sqrt(Decimal('0'))
5483 >>> ExtendedContext.sqrt(Decimal('-0'))
5485 >>> ExtendedContext.sqrt(Decimal('0.39'))
5487 >>> ExtendedContext.sqrt(Decimal('100'))
5489 >>> ExtendedContext.sqrt(Decimal('1'))
5491 >>> ExtendedContext.sqrt(Decimal('1.0'))
5493 >>> ExtendedContext.sqrt(Decimal('1.00'))
5495 >>> ExtendedContext.sqrt(Decimal('7'))
5497 >>> ExtendedContext.sqrt(Decimal('10'))
5499 >>> ExtendedContext.sqrt(2)
5505 return a.sqrt(context=self)
5753 # log1p(y) = 2*log1p(y/(1+sqrt(1+y)))