Post Reply 
(12C) Fractional Part Function
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
02 ENTER
03 .
04 5
05 -
06 2
07 EEX
08 9
09 +
10 LSTx
11 -
12 -

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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Fractional Part Function - Gamo - 01-03-2020, 05:34 AM
RE: (12C) Fractional Part Function - Gamo - 01-03-2020, 06:26 AM
RE: (12C) Fractional Part Function - Albert Chan - 01-03-2020 06:53 PM



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