MCPcopy Create free account
hub / github.com/ccxt/ccxt / mod

Method mod

python/ccxt/base/precise.py:121–127  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

119 return Precise(-self.integer, self.decimals)
120
121 def mod(self, other):
122 rationizerNumberator = max(-self.decimals + other.decimals, 0)
123 numerator = self.integer * (self.base ** rationizerNumberator)
124 rationizerDenominator = max(-other.decimals + self.decimals, 0)
125 denominator = other.integer * (self.base ** rationizerDenominator)
126 result = numerator % denominator
127 return Precise(result, rationizerDenominator + other.decimals)
128
129 def orn(self, other):
130 integer_result = self.integer | other.integer

Callers 2

__mod__Method · 0.95
string_modMethod · 0.45

Calls 2

PreciseClass · 0.70
maxFunction · 0.50

Tested by

no test coverage detected