Post Reply 
Adding Table of constant Units? how?
09-04-2016, 07:31 AM (This post was last modified: 09-04-2016 07:36 AM by Didier Lachieze.)
Post: #3
RE: Adding Table of constant Units? how?
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;
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? - Didier Lachieze - 09-04-2016 07:31 AM



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