Post Reply 
wp34s - FIB problem (DBLON)
11-23-2018, 10:32 AM
Post: #4
RE: wp34s - FIB problem (DBLON)
(11-23-2018 08:08 AM)ijabbott Wrote:  
(11-22-2018 07:59 PM)Gerson W. Barbosa Wrote:  That's a minor problem, actually. In double precision mode FIB returns a near-integer for most arguments. For example:

     10 FIB --> 54.99999999999999999999999999999995

A simple workaround is

10 FIB CEIL --> 55

Is it possible for the result of FIB (for a whole number) to be slightly larger than a whole number? If so, ROUNDI would be better than CEIL here.

I'd examined FIB(23) down to FIB(1) prior to choosing CEIL, but you're right, ROUNDI is a safer alternative.

Here's my modified program:

0001 **LBL A
0002 RCL X
0003 # 002
0004 MOD
0005 STO+ X
0006 DEC X
0007 # 000
0008 ENTER[^]
0009 STOS 00
0010 R[^]
0011 FIB
0012 CEIL
0013 RCL 03
0014 INC X
0015 FIB
0016 CEIL
0017 RCL 03
0018 STO+ X
0019 INC X
0020 RCL X
0021 FIB
0022 CEIL
0023 x[<->] Y
0024 INC X
0025 FIB
0026 CEIL
0027 RCL- 02
0028 STOS 04
0029 **LBL 000
0030 RCL 07
0031 1/x
0032 STO+ 00
0033 RCL L
0034 STO- 06
0035 x[<->] 06
0036 STO 07
0037 RCL L
0038 x[^2]
0039 RCL[times] 02
0040 RCL 05
0041 RCL+ 01
0042 STO/ Y
0043 y[<->] 01
0044 RCL L
0045 STO- 04
0046 x[<->] 04
0047 STO 05
0048 DSE 03
0049 GTO 000
0050 RCL+ 01
0051 1/x
0052 RCL+ 00
0053 END


9 A --> 3.359885666243177553172011302918927
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: wp34s - FIB problem (DBLON) - ijabbott - 11-23-2018, 08:08 AM
RE: wp34s - FIB problem (DBLON) - Gerson W. Barbosa - 11-23-2018 10:32 AM



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