This function's argument is the result from
find_big_2_to_nth()
.
The low-order digit in big
is in the
B's place, that is the 2's place in binary,
the 10's place in decimal, and so on.
def find_radix_from_big_2_to_nth(big):
"""The radix is marked by a change in the 'tens' place.
Args:
big: smallest value satisfying |((big + 1) - big) - 1| >= 1
Returns:
radix, which may not be integral in log arithmetic
"""
The loop simply adds the values 1, 2, 4, 8, ...
in sequence until b
exceeds big
.
In binary, this will happen on the first or second step, but
the result is the same.
In decimal, the low order digit will change when y
is 8 or 16, depending on whether the arithmetic is
rounded or chopped.
The digits x
and z
depend
on the decimal precision, but the algorithm applies, regardless.
y = ONE
while True:
b = big + y
y = y + y
b = b - big
if b != ZERO: break
return b