Self numbers: Difference between revisions
m
→{{header|Phix}}: inlined a routine
m (→{{header|Phix}}: replicated otrginal comment) |
m (→{{header|Phix}}: inlined a routine) |
||
Line 910:
output &= currentSelf
return (counter = endIndex)
-- Work out a shorter run length based on the most significant digit change about to happen.▼
integer shorterRunLength = 9,▼
temp = floor(currentSelf/1000)▼
while remainder(temp,10)=9 do▼
temp = floor(temp/10)▼
end while▼
end function
Line 968 ⟶ 957:
end for
-- Two shorter runs, the second at an interval inversely related to their length.
integer
▲ temp = floor(currentSelf/1000)
▲ -- Work out a shorter run length based on the most significant digit change about to happen.
▲ while remainder(temp,10)=9 do
▲ temp = floor(temp/10)
▲ end while
for i=1 to 2 do
if doneAfterAdding(interval) then return output end if
|