MCPcopy Index your code
hub / github.com/RustPython/RustPython / ln

Method ln

Lib/_pydecimal.py:4640–4660  ·  view source on GitHub ↗

Returns the natural (base e) logarithm of the operand. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> c.ln(Decimal('0')) Decimal('-Infinity') >>> c.ln(Decimal('1.000')) Decimal('0') >>> c.ln(Decimal('2.71828183')

(self, a)

Source from the content-addressed store, hash-verified

4638 return a.is_zero()
4639
4640 def ln(self, a):
4641 """Returns the natural (base e) logarithm of the operand.
4642
4643 >>> c = ExtendedContext.copy()
4644 >>> c.Emin = -999
4645 >>> c.Emax = 999
4646 >>> c.ln(Decimal('0'))
4647 Decimal('-Infinity')
4648 >>> c.ln(Decimal('1.000'))
4649 Decimal('0')
4650 >>> c.ln(Decimal('2.71828183'))
4651 Decimal('1.00000000')
4652 >>> c.ln(Decimal('10'))
4653 Decimal('2.30258509')
4654 >>> c.ln(Decimal('+Infinity'))
4655 Decimal('Infinity')
4656 >>> c.ln(1)
4657 Decimal('0')
4658 """
4659 a = _convert_other(a, raiseit=True)
4660 return a.ln(context=self)
4661
4662 def log10(self, a):
4663 """Returns the base 10 logarithm of the operand.

Callers 1

test_lnMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
lnMethod · 0.45

Tested by 1

test_lnMethod · 0.76