HP Forums
#Constant - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: #Constant (/thread-4912.html)



#Constant - Powersoft - 10-10-2015 09:24 AM

Hi all,

Is it posible to define a constant in the HP Prime?

like: Deg2Rad => pi/180

Cheers,

Jan


RE: #Constant - roadrunner - 10-10-2015 10:39 AM

Do you mean something different than the Define function command (shift/Define)?

[attachment=2654]

-Road


RE: #Constant - komame - 10-10-2015 06:01 PM

(10-10-2015 10:39 AM)roadrunner Wrote:  Do you mean something different than the Define function command (shift/Define)?

Generally the "Define" is ok for calculations in HP Prime, but not for programming purposes.
Equivalent of "const" like from other programming languages would be useful.
Currently, it can be replaced by using variable, but the use of a "const" would definitely be faster and safer (to prevent overwriting of value).
The use of variable requires reading its values everytime when it is used in program. In contrast, a constant is substituted at the stage of compilation and it is not needed to be reading during program execution.


RE: #Constant - cyrille de brébisson - 10-12-2015 06:53 AM

Hello,

Nope, there is no such thing in PPL. Sorry.

Cyrille