How to obtain the representation of an arbitrary fraction in a particular base? For example, the representation of 1/3 in base 2 should be
[[0], [0, 1, 0, 1, 0, 1, ...]
But when I type digits(1/3, 2)
in GP shell and press Enter, all I see is the following error:
? digits(1/3, 2)
*** at top-level: digits(1/3,2)
*** ^-------------
*** digits: incorrect type in digits (t_FRAC).
How to solve the problem?