Previous Page Next Page Contents

fp::fixedpt -- returns fixed point of a function

Introduction

fp::fixedpt(f) returns the fixed point of the unary function f.

Call(s)

fp::fixedpt(f)

Parameters

f - unary function

Returns

A unary function.

Details

Example 1

A function computing the Fibonacci numbers is created as a fixed point:

>> fb2 := (f,n) -> if n <= 2 then 1 else f(n-1) + f(n-2) end:
   fib := fp::fixedpt(fp::curry(fb2)):
   fib(i) $ i=1..9
                       1, 1, 2, 3, 5, 8, 13, 21, 34

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000