Post Reply 
(12C) Decimal to Fraction
08-09-2018, 07:46 AM
Post: #27
RE: (12C) Decimal to Fraction
(08-09-2018 12:51 AM)Gamo Wrote:  This routine is to check for the FIX setting.

If 0.000 the result will show 3

This might be helpful to use in the decimal to fraction program.

I cannot see how this may be related to the topic of this thread, but anyway it's a nice little utility that you may post in a separate thread.

The program calculates round(1/3) – 1/3. This is always negative, so there is no need for an ABS via ENTER × √x: a CHS will do. Or simply reverse the order: 1/3 – round(1/3) is always positive. I assume that after this usually the base-10-logarithm is calculated, which the 12C does not offer. But instead of dividing the natural log by ln 10 (which is slow) here any value between 2,193 and 2,436 may be used. For instance √5 = 2,236. This is faster than a log and saves one step.

So here is an updated version. I added an ENTER at the start, just to be sure...

Code:
01 ENTER
02 3
03 1/x
04 ENTER
05 RND
06 -
07 1/x
08 LN
09 5
10 √x
11 ÷
12 INTG
13 GTO 00

FIX 4 [R/S] => 4,0000

Re. line 07/08: LN CHS may by a tiiiny bit faster. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Decimal to Fraction - Gamo - 08-06-2018, 12:33 PM
RE: (12C) Decimal to Fraction - Dieter - 08-06-2018, 08:44 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 07:29 AM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 01:02 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 11:38 AM
RE: (12C) Decimal to Fraction - Gamo - 08-07-2018, 09:29 AM
RE: (12C) Decimal to Fraction - Joe Horn - 08-07-2018, 06:28 PM
RE: (12C) Decimal to Fraction - Dieter - 08-07-2018, 07:10 PM
RE: (12C) Decimal to Fraction - Joe Horn - 08-08-2018, 12:28 AM
RE: (12C) Decimal to Fraction - Dieter - 08-08-2018, 07:04 PM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 09:27 AM
RE: (12C) Decimal to Fraction - Dieter - 08-08-2018, 09:44 PM
RE: (12C) Decimal to Fraction - Gamo - 08-09-2018, 12:51 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018 07:46 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 08:09 AM
RE: (12C) Decimal to Fraction - Gamo - 08-09-2018, 09:16 AM
RE: (12C) Decimal to Fraction - Dieter - 08-09-2018, 10:30 AM
RE: (12C) Decimal to Fraction - Dieter - 08-10-2018, 12:28 PM
RE: (12C) Decimal to Fraction - Gamo - 05-07-2019, 01:44 AM
RE: (12C) Decimal to Fraction - Dieter - 08-10-2018, 07:06 PM



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