Yes, because 1 / 2 is mathematically infinite in base 3, just like how A=1/3 and B=10 doesn't terminate.

On 12/02/2024 07:31, Georgi Guninski wrote:
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/cd9f2832-5511-41a1-8abd-23df7326ab47%40gmail.com.

Reply via email to