repl.txt (991B)
1 2 {{alias}}( n ) 3 Computes the nth negaFibonacci number. 4 5 The negaFibonacci numbers follow the recurrence relation 6 7 F_{n-2} = F_{n} - F_{n-1} 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 12 negaFibonacci numbers cannot be accurately represented due to limitations of 13 double-precision floating-point format. 14 15 If not provided a non-positive 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 NegaFibonacci 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}}( -80 ) 44 NaN 45 > y = {{alias}}( NaN ) 46 NaN 47 48 See Also 49 -------- 50