Difference: PARS-tutorial-ex6 ( vs. 1)

Revision 12014-09-12 - DamianLyons

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="PARS-tutorial"
Exercise: Use tail recursion and PASS to build a process that raises its first argument to the power of the second, assuming that the first is a real number and the second is a positive integer.

EXP<x,a,v> = NEQ<a,0> ; PASS<v*x> ; EXP<x,a-1,res> .

The third argument needs to be set to 1 initially. So EXP<10,3,1> calculates 10^3

-- (c) Fordham University Robotics and Computer Vision

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback