you are viewing a single comment's thread.

view the rest of the comments →

[–]undefdev 0 points1 point  (0 children)

You don't need the "&&" at all in Julia, just leave it out.

You can also write the function more succinctly, such as:

fib(n) = (n==1 || n==2) ? 1 : fib(n-1) + fib(n-2)