File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ fib_bits = (n) ->
5252
5353 bits = []
5454 while n > 0
55- [n, bit] = divmodBasic( n, 2)
56- bits.push( bit)
55+ [n, bit] = divmodBasic n, 2
56+ bits.push bit
5757
5858 bits.reverse()
5959 return bits
@@ -67,7 +67,7 @@ fibFast = (n) ->
6767
6868 [a, b, c] = [1, 0, 1]
6969
70- for bit in fib_bits(n)
70+ for bit in fib_bits n
7171 if bit
7272 [a, b] = [(a+c)*b, b*b + c*c]
7373 else
@@ -88,12 +88,12 @@ divmodBasic = (x, y) ->
8888 Burnikel / Ziegler _ if_ possible...
8989 ###
9090
91- return [(q = Math.floor( x/y) ), (r = if x < y then x else x % y)]
91+ return [(q = Math.floor x/y), (r = if x < y then x else x % y)]
9292
9393start = (new Date).getTime();
9494calc_value = fibFast(MAXIMUM_JS_FIB_N)
9595diff = (new Date).getTime() - start;
96- console.log( "[ #{calc_value}] took #{diff} ms.")
96+ console.log "[ #{calc_value}] took #{diff} ms."
9797{% endhighlight %}
9898
9999## Discussion
You can’t perform that action at this time.
0 commit comments