![]() |
[WP34s] RSD function - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: [WP34s] RSD function (/thread-237860.html) |
[WP34s] RSD function - Dieter - 01-27-2013 The 34s features a very useful function that rounds a value to a certain number of significant digits - the RSD function. Some time ago I wrote a short program based on the "calculator forensics" routine that determines the perfect result an n-digit calculator should return: 001 LBL AEnter a number of digits (n), run the program (preferably in double precision) and the perfect result for a perfect n-digit machine will be returned. 12 [A] 8,99999864267Now try this... 0 [A]...and see what you get. Then single-step through the program and see what happens at step 012/013 where ACOS returns 90 degrees which is then rounded to 0 significant digits.
Finally try the same directly from the keyboard: 90 RSD 0and compare the result with the previous one. Which leads to the question: what is RSD 0 supposed to return?
Dieter
Re: [WP34s] RSD function - Walter B - 01-27-2013 RSD 0 is rubbish per definition. 1 is the lowest value making sense. We'll catch that bug - thanks for reporting.
d:-)
Re: [WP34s] RSD function - Dieter - 01-27-2013 Well, in a way RSD 0 can make sense: 0,02 RSD 0 => 0,01But limiting the argument for RSD to values >= 1 is fine by me either. ;-) Please also note that the current implementation may return different results in run and program mode. 90 RSD 0 here returns either 1E-14 or 10. Maybe you can check this as well. Dieter
Edited: 27 Jan 2013, 2:07 p.m. after one or more responses were posted
Re: [WP34s] RSD function - Doug (NYC) - 01-27-2013 In other words, RSD 0 in Dieter's mind is simply a "power of 10 orders of magnitude" function. It always returns "1. E X", where X is the appropriate order of magnitude. Or, presumably, 0. Cheers, Doug
Re: [WP34s] RSD function - Dieter - 01-27-2013 If (!) RSD 0 is accepted it may behave as follows: SIGNThis rounds X to the next closest power of 10. Which IMHO is the logical continuation of the way RSD works otherwise: X RSD 2 RSD 1 RSD 0Dieter Re: [WP34s] RSD function - Walter B - 01-27-2013 Interesting continuation of the RSD function. Nevertheless I prefer stopping with RSD 1 for ... ummh ... philosophical reasons. A number can feature one or more significant digits. If it would feature zero significant digits, its overall significance would vanish. Hope this is logical.
d:-)
Re: [WP34s] RSD function - Paul Dale - 01-27-2013 Rounding modes?
- Pauli
Re: [WP34s] RSD function - Walter B - 01-28-2013 Dieter, Quote:I've checked and must confirm this. No idea, however, why 0 COS RSD 0 returns 1e-14. BTW, this occurs both in manual mode and if called from a program - reproducible as it ought to be, at least.
d:-?
Re: [WP34s] RSD function - Dieter - 01-28-2013 RM is 0.
Dieter
Re: [WP34s] RSD function - Dieter - 01-28-2013 Try this (in DEG mode): 0 ACOS => 90Both the emulator (3.2 3350) and the "real thing" (3.2 3360) behave this way. So, in which way is the 90 returned by ACOS different from the same value keyed in manually?
Finally, try this: 0 ACOS => 90It's hard to describe, but there seems to be some kind of ..."leftover" from the trig function that is removed with the next operation (here +0 resp. x1). Any idea? Dieter
Edited: 28 Jan 2013, 2:58 p.m.
Re: [WP34s] RSD function - Walter B - 01-28-2013 Quote:Not yet. But we are going to get rid of RSD 0 anyway (though this behaviour shall be explained).
d:-)
Re: [WP34s] RSD function - Walter B - 01-29-2013 Build 3363 doesn't allow RSD 0 anymore.
d:-)
|