Paste: find Fibonacci numbers <= max

Author: kernigh
Mode: factor
Date: Sat, 5 May 2012 21:19:00
Plain Text |
:: fibs ( max -- seq )
  [
    0 , 0 1
    [ dup max > ] [
      dup ,                 ! Store last Fibonacci number.
      [ nip ] [ + ] 2bi     ! Calculate next Fibonacci number.
    ] until 2drop
  ] V{ } make ;

New Annotation

Summary:
Author:
Mode:
Body: