time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (976B)


      1 
      2 {{alias}}( n )
      3     Computes the nth negaLucas number.
      4 
      5     The negaLucas numbers follow the recurrence relation
      6 
      7       L_{n-2} = L_{n} - L_{n-1}
      8 
      9     with seed values L_0 = 2 and L_{-1} = -1.
     10 
     11     If `|n|` is greater than `76`, the function returns `NaN` as larger
     12     negaLucas 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         NegaLucas number.
     28 
     29     Examples
     30     --------
     31     > var y = {{alias}}( 0 )
     32     2
     33     > y = {{alias}}( -1 )
     34     -1
     35     > y = {{alias}}( -2 )
     36     3
     37     > y = {{alias}}( -3 )
     38     -4
     39     > y = {{alias}}( -4 )
     40     7
     41     > y = {{alias}}( -77 )
     42     NaN
     43     > y = {{alias}}( -78 )
     44     NaN
     45     > y = {{alias}}( NaN )
     46     NaN
     47 
     48     See Also
     49     --------
     50