Return-Value of function

Return-Value of function

Post by Oliver Scharnefsk » Fri, 18 Aug 2000 04:00:00



Hello,

I would like to get the contents of a return-value in a function through
the de*, how can I get it ?

double Fakultaet(int Zahl)
{
   if (Zahl > 1)
   return(Zahl*Fakultaet(Zahl-1));        // How can I get the actual
contents of the 'return'-value ?
    else
    return(1);

Quote:}

Thanks for answer
Oliver

 
 
 

Return-Value of function

Post by Magnus \sterli » Fri, 18 Aug 2000 04:00:00


Quote:> double Fakultaet(int Zahl)
> {
>    if (Zahl > 1)
>    return(Zahl*Fakultaet(Zahl-1));        // How can I get the actual
> contents of the 'return'-value ?
>     else
>     return(1);
> }

This all depends on the de* you are using .. I use Visual C++,
and the built in de*, so it's just a matter of single stepping
through the code, which will also step into the recursive function
call..

The code you gave just calcs the factorial of a number (n! in
math terms), and looks correct, so I don't really see why you
need to debug it ..

// magnus

 
 
 

1. Evaluating and Returning the Value of a Function

Is there any *simple* way to determine the value of a
function at a point?

e.g. something like:

gnuplot> eval(cos(0.0))

1.0

To the extent that gnuplot is used to interactively play with functions
and data, this would be (for me at least) a very useful basic feature.
Of course, it would also be nice to be able to pick off values from
a plot via cursor and mouse click.

Allan Dobbins

P.S. using pre3.6 b340

2. mdl3 problem

3. POV-Ray 3.1 : Returning a value!

4. cms setup question

5. returned from-0 value-2 days in-help!

6. Macromodel won't run in Windows 95 Build 347

7. what gversion values can an O2 return?

8. PostScript -> anything raster-like ??

9. max return value ...

10. Odd return values from LScript Control Objects.

11. Values returned from glReadPixels slightly off.

12. Click Return Value

13. Using Z value returned by gluProject