Phi Function
07-21-2015, 08:39 PM
Post: #1
 douganc Junior Member Posts: 34 Joined: Sep 2014
Phi Function
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

Attached File(s) Thumbnail(s)

07-21-2015, 09:06 PM (This post was last modified: 07-21-2015 09:07 PM by salvomic.)
Post: #2
 salvomic Senior Member Posts: 1,394 Joined: Jan 2015
RE: Phi Function
(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

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
07-21-2015, 11:28 PM
Post: #3
 douganc Junior Member Posts: 34 Joined: Sep 2014
RE: Phi Function
Thank You for Help.
Much Appreciated
Colm. :-)
07-22-2015, 05:24 AM
Post: #4
 Gerald H Senior Member Posts: 1,522 Joined: May 2014
RE: Phi Function
The term "phi function" is already occupied

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

You could amend to "phi constant"?
07-22-2015, 08:58 AM
Post: #5
 douganc Junior Member Posts: 34 Joined: Sep 2014
RE: Phi Function
Yes of course, it's a constant not a function.
Colm :-)
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)