MCPcopy Index your code
hub / github.com/python/cpython / __mul__

Method __mul__

Lib/statistics.py:1399–1405  ·  view source on GitHub ↗

Multiply both mu and sigma by a constant. Used for rescaling, perhaps to change measurement units. Sigma is scaled with the absolute value of the constant.

(x1, x2)

Source from the content-addressed store, hash-verified

1397 return NormalDist(x1._mu - x2, x1._sigma)
1398
1399 def __mul__(x1, x2):
1400 """Multiply both mu and sigma by a constant.
1401
1402 Used for rescaling, perhaps to change measurement units.
1403 Sigma is scaled with the absolute value of the constant.
1404 """
1405 return NormalDist(x1._mu * x2, x1._sigma * fabs(x2))
1406
1407 def __truediv__(x1, x2):
1408 """Divide both mu and sigma by a constant.

Callers

nothing calls this directly

Calls 1

NormalDistClass · 0.85

Tested by

no test coverage detected