如何获得特定基数中任意分数的表示?例如,以 2 为底的 1/3 的表示应该是
[[0], [0, 1, 0, 1, 0, 1, ...]
但是当我输入digits(1/3, 2)
GP shell 并按 Enter 时,我看到的只是以下错误:
? digits(1/3, 2)
*** at top-level: digits(1/3,2)
*** ^-------------
*** digits: incorrect type in digits (t_FRAC).
如何解决问题?