The following sequence of instructions, convert a periodic decimal number to its exact value 0.324532453245 = 3245/9999, I see something strange in the IP function (line 6), it must return 3245 and not 3244
iPart(3245) [enter] 3245.0
IP(3245) [enter] 3244 => 3245 (hpprime)
trunc(3245) [enter] 3245
Code : Tout sélectionner
1: autosimplify(0):;purge(f);
2: expr1:=(f=0.324532453245);
3: expr2:=expr1*10000;
4: expr3:=(expr2-expr1);
5: expr3:=simplify(expr3);
6: expr3:=(left(expr3)=IP(right(expr3)));
7: expr4:=expr3/9999;
8: expr4:=simplify(left(expr4))=(right(expr4));
9: approx(expr4)
10:right(expr1)
11:exact(right(expr1))