(12C) Signum Function - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (12C) Signum Function (/thread-12529.html) Pages: 1 2 |
RE: (12C) Signum Function - Dieter - 03-04-2019 10:49 AM (03-03-2019 06:52 PM)Gerson W. Barbosa Wrote: That’s what I get on my TI 57, but on my 12c Prestige (and on the latest Platinums, I presume), arguments on the display cannot be reused after an operator. But it seems to have worked on early 12CPs, as Robert noted. (03-03-2019 06:52 PM)Gerson W. Barbosa Wrote: IMHO, this is a feature, not a bug. Although the old behavior is apparently more convenient in some situations, I prefer this new one I prefer the other way as it can shorten and simplify quite a lot of calculations. For instance the sum formula (n²+n)/2, that's simply + x² / 2. Add an "=" before the division, if required. On some (many, most, all?) TIs, e.g. the 58/59, there even was a way to re-enter the displayed value during a calculation by means of the CE key, as in 5 x ( CE + 1 ) / 2 = I really appreciated this as it helped overcome the limitations of AOS (a bit). But then... (03-03-2019 06:52 PM)Gerson W. Barbosa Wrote: (or at least I would if I chose ALG, which I never will). That's what I really love about RPN: it's direct, straightforward and unambiguos. It simply does what you tell it to do and intermediate results can be freely stored on the stack. Dieter RE: (12C) Signum Function - Dieter - 03-04-2019 10:57 AM (03-02-2019 03:00 AM)Gerson W. Barbosa Wrote: That's a nice one. I probably would have used e^x to convert 0 into 1, but n! does it either, and maybe it's a tiiiiiiiiiny bit faster. This also makes a nice ABS code: Code: 01 ENTER This leaves the original input in Y and its absolute value in X. And again it does not have the problems of the x² √x method: it neither underflows for very small values not does it cause inaccuracies for about one out of five arguments (cf. Thomas' post). Dieter RE: (12C) Signum Function - Gerson W. Barbosa - 03-04-2019 08:11 PM (03-04-2019 10:57 AM)Dieter Wrote: This also makes a nice ABS code: In order to use that as a function I’d rather get rid of the original input, but I cannot do it in less than five steps on the HP-12C: Code:
On the HP-25 it can be done with four steps: Code:
It won’t beat the usual method, though: Code:
|-3.43142| = 3.431420001 might not be much of problem for most applications, I think. Gerson. |