On Sat, Feb 10, 2024 at 6:24 PM Georgi Guninski <ggunin...@gmail.com> wrote:
>
>
> ```
> def base_B_digits(A, B,prot=False):
>     digits=[]
>     fractional_part = A - int(A)
>     while fractional_part != 0:
>        digit = int(fractional_part * B)
>        digits.append(digit)
>        fractional_part = fractional_part * B - digit
>        if prot:  print(fractional_part)
>     return digits
> ```
>
> I am not sure the program must terminate.
>

Just for the record, this this digit extraction algorithm doesn't terminate
for A=0.5 and B=3 in sage and pari/gp.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAGUWgD9Oz1N%2BwQCVcucyMJCUeH6n6bjDFCCydR7qeqrMFkwVgQ%40mail.gmail.com.

Reply via email to