Computer Science Canada

Function and Procedure: Without Exponential Operator?

Author:  PrinceCooper [ Mon Jun 13, 2011 9:52 am ]
Post subject:  Function and Procedure: Without Exponential Operator?

Problem:
The program needs to use a function named Power that raises its first parameter (a real value) to the power indicated by the second parameter (an integer), without using the exponential operator (**). The function will return the result.

Issue:
I can achieve this WITH the use of the exponential operator, but completely confused without it.
I would appreciate it if someone could help me with this problem and explain how they came to their conclusion so I can avoid this issue in the future if at all possible.

Bonus:
Change the function into a procedure that returns the result of power operation into a third parameter.




4.0.4c[/b]

Author:  Tony [ Mon Jun 13, 2011 10:00 am ]
Post subject:  RE:Function and Procedure: Without Exponential Operator?

The idea is to implement the exponential operator as a Power function, so you should start with the definition -- how is the ** operator defined (what exactly does it do)?


: