The Museum of HP Calculators

HP Forum Archive 20

 HP 30b RND functionMessage #1 Posted by Sujith Abraham on 25 Apr 2011, 6:33 a.m. I am just curious how this is supposed to work. The manual says, on page 19 that it: "Rounds x to the number specified by the display format" What is display format? Is it FIX? When I press [Shift]+[RND] nothing is happening. An illustration of how it is supposed to be used would be very helpful. Thanks

 Re: HP 30b RND functionMessage #2 Posted by Norman Dziedzic on 25 Apr 2011, 6:54 a.m.,in response to message #1 by Sujith Abraham You are correct, it rounds to the number of decimals set with FIX. To see the effects, calculate something with a repeating decimal like 1/3. Then set FIX 3 and RND. Then show all digits or set FIX higher than 3 and you will see 0.33300000.. You don't see it when you do it because it is rounding away the decimals you cannot see at the time.

 Re: HP 30b RND functionMessage #3 Posted by Dieter on 25 Apr 2011, 8:36 a.m.,in response to message #1 by Sujith Abraham You will find the answer yourself once you realize that there are two different things here: On the one hand there is the number of digits the calculator is working with. This may be something like 10, 12 or 16 digits, depending on the model. The calculator always uses this many digits for all its calculations, and all results have this precision. On the other hand there is the number of digits you want to see in the display. If you set FIX 2 you tell the calculator "just show me two decimals - I don't need to know the rest". This display setting only affects the number of digits you see, while internally all values and results still have their full 10, 12 or 16 digits. The round function now does this: it replaces the current full-precision value by the rounded number you see in the display. In other words: before, the number only was displayed with two decimals, and afterwards it actually has only two decimals. Assume the current value is Pi = 3,141592653589793238462643... and your calculator works with 12 digits. This is what happens: ``` --- display set to --- FIX 2 FIX 4 now you see 3,14 3,1416 press 3,1416 [RND] calculator 3,14159265359 3,14159265359 => 3,141600000000 works with ``` So in FIX the round function rounds to the chosen number of digits behind the decimal point. In SCI and ENG it rounds to the number of significant digits you see. Finally try FIX 2, enter a value like 0,000004 and see what the round function does now. Dieter Edited: 25 Apr 2011, 8:39 a.m.

 Re: HP 30b RND functionMessage #4 Posted by Sujith Abraham on 1 May 2011, 10:10 p.m.,in response to message #3 by Dieter Thanks for the replies Norman and Dieter. I had RND in my Casio also, but it is only now I get its use! One area I may be able to use this may be to get correct answers: answers in my text's TVM calculations, which uses data from PV Tables. Can you please share what you use RND on your HPs? Since many of you use it in real life situations, it would be interesting.

 Re: HP 30b RND functionMessage #5 Posted by Thomas Radtke on 25 Apr 2011, 9:18 a.m.,in response to message #1 by Sujith Abraham Quote:The manual says, on page 19 that it: "Rounds x to the number specified by the display format" That sentence has to be corrected. The 35s manual is clear about RND: "Rounds x to n decimal places in FIX n display mode".

 Re: HP 30b RND functionMessage #6 Posted by C.Ret on 25 Apr 2011, 12:32 p.m.,in response to message #5 by Thomas Radtke Hi, Perhaps a more correct sentence wil only mention "Display Format" since the RND instruction is rounding depending of displayed numbers in SCI n or ENG n modes (on model whre these modes are available). Example: '4.pi' ```Mode : DISPLAY: RND result: STD 12.5663706144 12.5663706144 FIX 4 12.5664 12.5664000000 (note the fourth decimal round up) SCI 4 1.2566 E+01 12.5660000000 ENG 4 12.566 E+00 12.5660000000 ```

 Re: HP 30b RND functionMessage #7 Posted by Thomas Radtke on 25 Apr 2011, 12:55 p.m.,in response to message #6 by C.Ret The manual actually mentions that. I've omitted it since it appeared to me 'FIX' was in focus of this thread. My fault.

Go back to the main exhibit hall