(12C) Signum Function
03-04-2019, 08:11 PM (This post was last modified: 03-04-2019 08:16 PM by Gerson W. Barbosa.)
Post: #23
 Gerson W. Barbosa Senior Member Posts: 1,297 Joined: Dec 2013
RE: (12C) Signum Function
(03-04-2019 10:57 AM)Dieter Wrote:  This also makes a nice ABS code:

Code:
01 ENTER  02 CHS 03 x<=y 04 CHS

This leaves the original input in Y and its absolute value in X.

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:
 01 0 02 x<=y 03 x<>y 04 - 05 CHS

On the HP-25 it can be done with four steps:

Code:
 01 0 02 x>y 03 x<>y 04 -

It won’t beat the usual method, though:

Code:
 01 x^2 02 sqrt

|-3.43142| = 3.431420001 might not be much of problem for most applications, I think.

Gerson.
 « Next Oldest | Next Newest »

 Messages In This Thread (12C) Signum Function - Gamo - 03-01-2019, 06:29 AM RE: (12C) Signum Function - Gerson W. Barbosa - 03-02-2019, 03:00 AM RE: (12C) Signum Function - Dieter - 03-04-2019, 10:57 AM RE: (12C) Signum Function - Gerson W. Barbosa - 03-04-2019 08:11 PM RE: (12C) Signum Function - Gamo - 03-02-2019, 05:47 AM RE: (12C) Signum Function - Dieter - 03-02-2019, 05:22 PM RE: (12C) Signum Function - rprosperi - 03-02-2019, 08:57 PM RE: (12C) Signum Function - Gamo - 03-03-2019, 02:31 AM RE: (12C) Signum Function - Dieter - 03-03-2019, 12:38 PM RE: (12C) Signum Function - Thomas Klemm - 03-03-2019, 08:17 AM RE: (12C) Signum Function - Albert Chan - 03-03-2019, 01:15 PM RE: (12C) Signum Function - Gerson W. Barbosa - 03-03-2019, 07:03 PM RE: (12C) Signum Function - Gamo - 03-03-2019, 02:39 PM RE: (12C) Signum Function - rprosperi - 03-03-2019, 03:34 PM RE: (12C) Signum Function - Dieter - 03-03-2019, 05:51 PM RE: (12C) Signum Function - Gerson W. Barbosa - 03-03-2019, 06:52 PM RE: (12C) Signum Function - Dieter - 03-04-2019, 10:49 AM RE: (12C) Signum Function - rprosperi - 03-03-2019, 07:59 PM RE: (12C) Signum Function - Thomas Klemm - 03-03-2019, 04:59 PM RE: (12C) Signum Function - Albert Chan - 03-03-2019, 07:49 PM RE: (12C) Signum Function - Thomas Klemm - 03-03-2019, 11:27 PM RE: (12C) Signum Function - Albert Chan - 03-04-2019, 02:02 AM RE: (12C) Signum Function - Gamo - 03-04-2019, 04:58 AM

User(s) browsing this thread: 1 Guest(s)