Goodstein Sequence: Difference between revisions

Content deleted Content added
Petelomax (talk | contribs)
m →‎{{header|Phix}}: cut out the middleman, fix a trailing ".0" which had crept in
Petelomax (talk | contribs)
m →‎{{header|Phix}}: removed an unnecessary abs()
Line 139: Line 139:
function digits(atom n, b)
function digits(atom n, b)
-- least significant first, eg 123,10 -> {3,2,1} or 6,2 -> {0,1,1}
-- least significant first, eg 123,10 -> {3,2,1} or 6,2 -> {0,1,1}
sequence r = {remainder(abs(n),b)}
sequence r = {remainder(n,b)}
while n>=b do
while n>=b do
n = floor(n/b)
n = floor(n/b)