-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Tablets and Mobile Devices Archive
- HP Prime using user variables with rpn set as input method

Create an account on the HP Community to personalize your profile and ask a question

01-31-2017 07:12 AM - edited 01-31-2017 09:22 AM
I am trying to ROUND a number to 2 decimal places in the HP Prime using RPN and it does not work. I have tried putting the arguments in the stack, such as:
19.127456
2
ROUND()
ENTER
And the stack is unchanged.
Thanks.
01-31-2017 09:42 AM
When a function can have optional arguments, such as the ROUND function which can have an optional second argument, then in RPN you are required to specify how many arguments it should take from the stack, by putting that number in parentheses right after the function. It looks funny but it works. So always type ROUND(2) no matter how many digits you're rounding to. The "(2)" in "ROUND(2)" tells Prime to take 2 numbers off the stack as the arguments for the ROUND function.
Example: To round pi to 4 places in RPN mode, do this:
PI
4
ROUND(2)
An alternative method is to put your Prime in Fixed 4 mode. Then the ROUND function by itself (with no explicit number of arguments specified) will only take one argument from the stack, and round it to the current display setting. So, in Fixed 4 mode, the following:
PI
ROUND
returns 3.1416 exactly.
Hope that helps! Disclaimer: I don't work for HP, but I enjoy playing with their calculators.
01-31-2017 10:39 AM - edited 02-01-2017 05:16 AM
Hi!, FeliO:
Welcome, to HP Forum !.
Syntax:
Description:
Examples:
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
02-01-2017 08:16 AM
Hi!, @FelixO:
Excuse, me by the omission !.
You needed write, as ...
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
