i am attempting to make a more precise way of calculating on the calculator, but it's not going too well(even though the code is so complex none of my schoolmates or teachers understand it XD)

for example, if i divide 4 over and over it does this

4

2

1

0.5

0.25

0.125

0.525(wrong)

and it keeps dividing into numbers that exist solely out of 1, 2, and 5

here's the code:

0>(phi)

4>A

clrhome

{8,0,0,0,0,0,0,

0,0,0,0,0,0,0,

0,0,0,0,0,0,0,

0,0,0,0,0,0,0,

0,0,0,0,0,0,0,

0}>L1

repeat (phi) = 1

L1>L2

for(B,40,1,-1)

if fPart(L1(b))>0

then

fPart(L1(B))*10>L1(B+1)

(L1(B)-fPart(L1(B))>L1(B)

output(8,4,B)

End

End

A/2—>A

Output(1,1,L1)

Output(7,1,A)

End

so basically what i want it to do is

it has 4(first place in the list is value 4)

divides by 2

checks for decimals(other than 0)

2 has no decimals, first place in the list gets value 2

divide by 2

1 has no decimals, first place in the list gets value 1

divide by 2

0.5 has 1 decimal, first place gets value 0, second place gets value 5

divide by 2

0.25 has 2 decimals, first place: 0, second: 2, third: 5

etc etc