(12C) Fractional Part Function
|
01-03-2020, 05:34 AM
(This post was last modified: 01-03-2020 05:43 AM by Gamo.)
Post: #1
|
|||
|
|||
(12C) Fractional Part Function
The HP-55 doesn't have FRAC and INT funtions and I'm happen to see some
program example from HP-55 User's Manual that program the fractional part routine in program. Try this Fractional Part routine and it work as expected on HP-12C Since this type of problem still exist on some programmble calculator that doesn't have these funtion, couple friend of my have ask me about this type of problem before and I didn' t know any good solution yet, until now. This FRAC functions routine only work on "Positive Integer" Example: FIX 9 2 [√X] display 1.414213562 [R/S] display 0.414213562 -------------------------------- 355 [ENTER] 113 [÷] display 3.141592920 [R/S] display 0.141592920 Program: FRAC function Quote:01 ENTER Remark: Program line 03 to 07 by itself canbe use as INT function. Gamo 1/3/2020 |
|||
01-03-2020, 06:15 AM
Post: #2
|
|||
|
|||
RE: (12C) Fractional Part Function
Doesn't the 12C have a FRAC function built in?
<0|ɸ|0> -Joe- |
|||
01-03-2020, 06:26 AM
Post: #3
|
|||
|
|||
RE: (12C) Fractional Part Function
Joe Horn
The HP-12C got these functions. Just demonstrate this routine on 12C as an example, so that people who got other HP programmable calculator that doesn't have this function can adapt to it. Also HP-55 manual use this algorithm so it must be good to share for those who interested. Gamo |
|||
01-03-2020, 02:13 PM
Post: #4
|
|||
|
|||
RE: (12C) Fractional Part Function
Aha, I understand now. Thanks, Gamo!
<0|ɸ|0> -Joe- |
|||
01-03-2020, 06:53 PM
(This post was last modified: 01-03-2020 07:53 PM by Albert Chan.)
Post: #5
|
|||
|
|||
RE: (12C) Fractional Part Function
(01-03-2020 05:34 AM)Gamo Wrote: Remark: Program line 03 to 07 by itself canbe use as INT function. I think it is more like ROUND function. We may go for FLOOR instead, remove the branching code. Quote:01 ENTER For -1E9 < v ≤ 8E9: above defined FRAC(v) as v - FLOOR(v) = v - (ROUND(v - 0.5 + 2E9) - 2E9) Example: 123.45 R/S → 0.45 123.45 CHS R/S → 0.55 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)