HP Forums
ROUND() Results - 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: ROUND() Results (/thread-18233.html)



ROUND() Results - matalog - 04-07-2022 09:09 PM

In Home view on my G2, ROUND(7979*464664664,2) Results in 3.70755935406E12.

That seems a rather long result for a figure rounded to 2 dp. Is that ROUND working as expected?


RE: ROUND() Results - Joe Horn - 04-07-2022 10:26 PM

Yes, that is the expected result. Here's why. 7979*464664664 = 3707559354056, which is a 13-digit integer, as can be verified in CAS. Home view rounds all numeric calculations to a 12-digit mantissa, which as you saw is 3.70755935406 × 10^12. Rounding this to "two decimal places" has no effect, since it has no fractional part. If you want to round it to two significant digits instead, use -2 instead of 2 in the ROUND command.


RE: ROUND() Results - matalog - 04-07-2022 10:41 PM

It seems then that in this case, I want to round the scientific notation to 2 decimal places. Is that possible?


RE: ROUND() Results - Joe Horn - 04-08-2022 04:21 AM

(04-07-2022 10:41 PM)matalog Wrote:  It seems then that in this case, I want to round the scientific notation to 2 decimal places. Is that possible?

Yes: ROUND(n,-3)

Suggestion: Type ROUND and then, while the cursor is still blinking there, press the Help key, it'll tell you all you want to know about the ROUND function. Ditto for other functions and operators.