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) ->
52
52
53
53
bits = []
54
54
while n > 0
55
- [n, bit] = divmodBasic( n, 2)
56
- bits.push( bit)
55
+ [n, bit] = divmodBasic n, 2
56
+ bits.push bit
57
57
58
58
bits.reverse()
59
59
return bits
@@ -67,7 +67,7 @@ fibFast = (n) ->
67
67
68
68
[a, b, c] = [1, 0, 1]
69
69
70
- for bit in fib_bits(n)
70
+ for bit in fib_bits n
71
71
if bit
72
72
[a, b] = [(a+c)*b, b*b + c*c]
73
73
else
@@ -88,12 +88,12 @@ divmodBasic = (x, y) ->
88
88
Burnikel / Ziegler _ if_ possible...
89
89
###
90
90
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)]
92
92
93
93
start = (new Date).getTime();
94
94
calc_value = fibFast(MAXIMUM_JS_FIB_N)
95
95
diff = (new Date).getTime() - start;
96
- console.log( "[ #{calc_value}] took #{diff} ms.")
96
+ console.log "[ #{calc_value}] took #{diff} ms."
97
97
{% endhighlight %}
98
98
99
99
## Discussion
You can’t perform that action at this time.
0 commit comments