Self numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: restored the word fast in "fast forward")
m (→‎{{header|AppleScript}}: Fixed a bug in the fastForward() handler that caused a hang when the start index was the last in a block.)
Line 55: Line 55:
repeat until ((indexDiff < 98) or (counter = startIndex))
repeat until ((indexDiff < 98) or (counter = startIndex))
set test to counter + indexDiff
set test to counter + indexDiff
if (test > startIndex) then
if (test < startIndex) then
set indexDiff to indexDiff div 10 + 1
set numericDiff to numericDiff div 10 + 1
else
set counter to test
set counter to test
set currentSelf to (currentSelf + numericDiff)
set currentSelf to (currentSelf + numericDiff)
else
set indexDiff to indexDiff div 10 + 1
set numericDiff to numericDiff div 10 + 1
end if
end if
end repeat
end repeat
Line 113: Line 113:


-- One hundred millionth:
-- One hundred millionth:
selfNumbers(100000000)
selfNumbers(9.777777778E+9 + 15)
--> {1.022727208E+9}</lang>
--> {1.022727208E+9}</lang>