Post Reply 
Adding Table of constant Units? how?
06-03-2019, 07:48 PM
Post: #11
RE: Adding Table of constant Units? how?
(09-04-2016 07:31 AM)Didier Lachieze Wrote:  I don't think you can define constants per se in the Prime but what you can do is defining global variables that you'll be able to use where you want. However you need to ensure that the name of your global variables don't conflict with the HP Prime predefined variables. Also as they are variables and not constants they can be modified so beware how you use them!

For example you can create a new program called "CONSTANTS", remove the CONSTANT template inside and just add these two lines and press Check:
Code:
EXPORT AU:=149597870691;
EXPORT ly:=9.460536207ᴇ12;

You have now created two global variables: ly light year in km and AU astronomical unit in km. You can use these variables to calculate for example the value of a light year in AU in this test program :
Code:
EXPORT TEST()
BEGIN
  RETURN(ly/AU);
END;

TY
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Adding Table of constant Units? how? - tom234 - 06-03-2019 07:48 PM



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