HP Forums

Full Version: Phi Function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
Can anyone tell me where I am going wrong in this Program?

It's purpose is to display the value of Phi to 50 Decimal Places
When "phi()" is typed on the home screen.

Here is the program:

#cas
phi():=BEGIN
//
LOCAL x;
x:=(1.61803398874989484820458683436563811772030917980576);
RETURN(x);
//
END;
#end

Output: See attached Screenshot.

Thanks !
Colm
(07-21-2015 08:39 PM)douganc Wrote: [ -> ]Hello,
Can anyone tell me where I am going wrong in this Program?

It's purpose is to display the value of Phi to 50 Decimal Places
When "phi()" is typed on the home screen.

Here is the program:

#cas
phi():=BEGIN
//
...

hi,
first detach BEGIN after the :=
Code:

#cas
phi():=
BEGIN
//
LOCAL x;
x:=(1.61803398874989484820458683436563811772030917980576);
RETURN(x);
//
END;
#end

after this you won't have that error, but
1.61803398875.
then the rest...

For "all dec" output see here.

Salvo
Thank You for Help.
Much Appreciated
Colm. :-)
The term "phi function" is already occupied

https://en.wikipedia.org/wiki/Euler%27s_...t_function

You could amend to "phi constant"?
Yes of course, it's a constant not a function.
Colm :-)
Reference URL's