repl.txt (923B)
1 2 {{alias}}( n ) 3 Computes the nth Fibonacci number. 4 5 Fibonacci numbers follow the recurrence relation 6 7 F_n = F_{n-1} + F_{n-2} 8 9 with seed values F_0 = 0 and F_1 = 1. 10 11 If `n` is greater than `78`, the function returns `NaN`, as larger Fibonacci 12 numbers cannot be accurately represented due to limitations of double- 13 precision floating-point format. 14 15 If not provided a nonnegative integer value, the function returns `NaN`. 16 17 If provided `NaN`, the function returns `NaN`. 18 19 Parameters 20 ---------- 21 n: integer 22 Input value. 23 24 Returns 25 ------- 26 y: integer 27 Fibonacci number. 28 29 Examples 30 -------- 31 > var y = {{alias}}( 0 ) 32 0 33 > y = {{alias}}( 1 ) 34 1 35 > y = {{alias}}( 2 ) 36 1 37 > y = {{alias}}( 3 ) 38 2 39 > y = {{alias}}( 4 ) 40 3 41 > y = {{alias}}( 79 ) 42 NaN 43 > y = {{alias}}( NaN ) 44 NaN 45 46 See Also 47 -------- 48