MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / logb

Method logb

tools/python-3.11.9-amd64/Lib/_pydecimal.py:4726–4750  ·  view source on GitHub ↗

Returns the exponent of the magnitude of the operand's MSD. The result is the integer which is the exponent of the magnitude of the most significant digit of the operand (as though the operand were truncated to a single digit while maintaining the value of that

(self, a)

Source from the content-addressed store, hash-verified

4724 return a.log10(context=self)
4725
4726 def logb(self, a):
4727 """ Returns the exponent of the magnitude of the operand's MSD.
4728
4729 The result is the integer which is the exponent of the magnitude
4730 of the most significant digit of the operand (as though the
4731 operand were truncated to a single digit while maintaining the
4732 value of that digit and without limiting the resulting exponent).
4733
4734 >>> ExtendedContext.logb(Decimal('250'))
4735 Decimal('2')
4736 >>> ExtendedContext.logb(Decimal('2.50'))
4737 Decimal('0')
4738 >>> ExtendedContext.logb(Decimal('0.03'))
4739 Decimal('-2')
4740 >>> ExtendedContext.logb(Decimal('0'))
4741 Decimal('-Infinity')
4742 >>> ExtendedContext.logb(1)
4743 Decimal('0')
4744 >>> ExtendedContext.logb(10)
4745 Decimal('1')
4746 >>> ExtendedContext.logb(100)
4747 Decimal('2')
4748 """
4749 a = _convert_other(a, raiseit=True)
4750 return a.logb(context=self)
4751
4752 def logical_and(self, a, b):
4753 """Applies the logical operation 'and' between each operand's digits.

Callers

nothing calls this directly

Calls 2

_convert_otherFunction · 0.85
logbMethod · 0.45

Tested by

no test coverage detected