(10C) ABSolute value Function
|
01-08-2019, 06:43 AM
(This post was last modified: 01-08-2019 06:45 AM by Gamo.)
Post: #1
|
|||
|
|||
(10C) ABSolute value Function
This little program steps is use for [ABS] the "Absolute Value" function.
This program steps only use "Test Function" while other method use Arithmetic calculations to get the Absolute Value. Here is the Arithmetic method: [X^2] [√X] Test Function method: 0 [X<>Y] [X≤Y] [CHS] ---------------------------------------------------- Example: Program to calculate + or - [√X] using ABS 100 [R/S] display 10 100 [CHS] [R/S] display 10 --------------------------------------------------- Program: Calculate [√X] using ABS to only return positive value Code:
Remark: This routine also work on HP-12C Gamo |
|||
01-08-2019, 07:47 AM
Post: #2
|
|||
|
|||
RE: (10C) ABSolute value Function
Shouldn't the last step be + not square root?
Pauli |
|||
01-08-2019, 08:07 AM
(This post was last modified: 01-09-2019 01:34 AM by Gamo.)
Post: #3
|
|||
|
|||
RE: (10C) ABSolute value Function
Usually the last line with √X is just the example.
Program without example is 01 0 02 X<>Y 03 X≤Y 04 CHS That example on line 05 √X When run any number it will always be positive then use square root. Gamo |
|||
01-09-2019, 03:12 AM
(This post was last modified: 01-09-2019 03:14 AM by Gamo.)
Post: #4
|
|||
|
|||
RE: (10C) ABSolute value Function
Example program to demonstrate the use of ABSolute Value.
This program make endless loop to keep subtracting 1 to accumulate negative value then use ABS to make it positive. [R/S] display "-1" 1 keep continue ...... Program: Code:
Gamo |
|||
01-09-2019, 04:14 AM
Post: #5
|
|||
|
|||
RE: (10C) ABSolute value Function
I was thinking about + removing the 0 from Y.
But since it was an example, it isn't important. |
|||
01-11-2019, 04:54 AM
Post: #6
|
|||
|
|||
RE: (10C) ABSolute value Function
I use the first method ([X^2] [√X]) for the HP 12C.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)