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

Method log10

Lib/_pydecimal.py:4662–4688  ·  view source on GitHub ↗

Returns the base 10 logarithm of the operand. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> c.log10(Decimal('0')) Decimal('-Infinity') >>> c.log10(Decimal('0.001')) Decimal('-3') >>> c.log10(Decimal('1.000'))

(self, a)

Source from the content-addressed store, hash-verified

4660 return a.ln(context=self)
4661
4662 def log10(self, a):
4663 """Returns the base 10 logarithm of the operand.
4664
4665 >>> c = ExtendedContext.copy()
4666 >>> c.Emin = -999
4667 >>> c.Emax = 999
4668 >>> c.log10(Decimal('0'))
4669 Decimal('-Infinity')
4670 >>> c.log10(Decimal('0.001'))
4671 Decimal('-3')
4672 >>> c.log10(Decimal('1.000'))
4673 Decimal('0')
4674 >>> c.log10(Decimal('2'))
4675 Decimal('0.301029996')
4676 >>> c.log10(Decimal('10'))
4677 Decimal('1')
4678 >>> c.log10(Decimal('70'))
4679 Decimal('1.84509804')
4680 >>> c.log10(Decimal('+Infinity'))
4681 Decimal('Infinity')
4682 >>> c.log10(0)
4683 Decimal('-Infinity')
4684 >>> c.log10(1)
4685 Decimal('0')
4686 """
4687 a = _convert_other(a, raiseit=True)
4688 return a.log10(context=self)
4689
4690 def logb(self, a):
4691 """ Returns the exponent of the magnitude of the operand's MSD.

Callers 1

test_log10Method · 0.95

Calls 2

_convert_otherFunction · 0.85
log10Method · 0.45

Tested by 1

test_log10Method · 0.76