diff --git a/IOTA-Kerl-spec.md b/IOTA-Kerl-spec.md index 356252f..d9ad43d 100644 --- a/IOTA-Kerl-spec.md +++ b/IOTA-Kerl-spec.md @@ -177,11 +177,11 @@ def convertBigintToTrits(bigInt): ``` def convertBigintToBase(bigInt,base,length): is_negative = bigInt < 0 - absolute_value = abs(bigInt) + quotient = abs(bigInt) MAX = is_negative ? base/2 : (base-1)/2 for i=1:length: - quotient,remainder = divmod(absolute_value, base) + quotient,remainder = divmod(quotient, base) if remainder > MAX: # Lend 1 to the next place so we can make this digit negative. quotient += 1