Anonymous user
Average loop length: Difference between revisions
m
→{{header|VBScript}}
Line 3,165:
=={{header|VBScript}}==
Ported from the VBA version. I added some precalculations to speed it up
<lang vb>
Const MAX = 20
Line 3,188:
count = count + 1
bits = bits Or x
x =
Loop
Next
Line 3,196:
function rf(v,n,s) rf=right(string(n,s)& v,n):end function
'some precalculations to speed things up...
dim fact(
fact(0)=1:shift(0)=1
for i=1 to 20 :fact(i)=i*fact(i-1): next▼
for i=1 to 20
shift(i)=2*shift(i-1)
next
Dim n
Line 3,237 ⟶ 3,241:
20 5.2906 5.2936 ( 0.0006%)
</pre>
=={{header|Wren}}==
{{trans|Go}}
|