Sponsored links: Algebra eBooks
 

Related

fpprec-fpprintprec

fpprintprec:4;

fpprec:4;

Zo:[107,107,92.5,92.5...

Calculate

fpprec-hypergeometric-true

hypergeometric([],[],x);

hypergeometric([-3],...

hypergeometric([-3],...

Calculate

fpprec

fpprec:100;

avg:2.6151428571b0;

fpprec:6;

Calculate

fpprec-fpprintprec-printf

fpprintprec :3;

fpprec:6;

x:30545345.145;

Calculate

fpprec-fpprintprec

fpprintprec :3;

fpprec:6;

x:305453.45145;

Calculate

fpprec-numer

r12: 1/(1/r1 + 1/r2);

r12brojno: r12, r1 = ...

r12brojno, numer;

Calculate

fpprec

fpprec : 100;

Calculate

fpprec

fpprec:100;

avg:2.6151428571b0;

fpprec:6;

Calculate

fpprec-plot2d-sin
plot2d(RelError(x),[x,0.0000000001,%pi/4], [nticks,200]);

fpprec:200;

mmfunc(x):= x-0.16666...

RelError(x):=(1-(mmfu...

Calculate

fpprec-numer-sqrt-true

fpprec:3;

numer:true;

x1:0;

Calculate

fpprec

Run Example
(%i1)define_variable (foo, 0, float);
(%o1)                                  0
(%i2) fpprec : 600;
(%o2)                                 600
(%i3) for m:301 step 1 thru 310 do(foo: bfloat(sum(k^m/3^k,k,1,2100)),foo: foo-floor(foo),disp(m,foo));
                                      301

                                     0.0b0

                                      302

                                     0.0b0

                                      303

                                     0.0b0

                                      304

                                     0.0b0

                                      305

                                     0.0b0

                                      306

                                     0.0b0

                                      307

                                     0.0b0

                                      308

                                     0.0b0

                                      309

                                     0.0b0

                                      310

                                     0.0b0

(%o3)                                done
(%i4) 
Run Example
u:sqrt(3)*230;
(%o1)                             230 sqrt(3)
(%i2) float(u);
(%o2)                          398.3716857408418
(%i3) fpprec:24;
(%o3)                                 24
(%i4) bfloat(u);
(%o4)                     3.98371685740841777511313b2
(%i5) x: (1/2) + (1/3);
                                       5
(%o5)                                  -
                                       6
(%i6) float(x);
(%o6)                          0.83333333333333
(%i7) bfloat(x);
(%o7)                    8.33333333333333333333333b-1
(%i8) y: %pi;
(%o8)                                 %pi
(%i9) float(y);
(%o9)                          3.141592653589793
(%i10) fpprec:128;
(%o10)                                128
(%i11) bfloat(y);
(%o11) 3.141592653589793238462643383279502884197169399375105820974944592307816\
4062862089986280348253421170679821480865132823066470938446b0
(%i12) float(%e);
(%o12)                         2.718281828459045
(%i13) 
Run Example
kill(lastdigits,pidigits, a, b);
(%o1)                                done
(%i2) ratprint:false;
(%o2)                                false
(%i3) pidigits(prec):=block([fpprec:prec+1], ratprint:false, bftorat:false, ratepsilon:2.0e-16, float2bf:false, ans:float((%pi-mod(%pi, 10^(-prec)))), return(ans));
(%o3) pidigits(prec) := block([fpprec : prec + 1], ratprint : false, 
bftorat : false, ratepsilon : 2.0E-16, float2bf : false, 
                             - prec
ans : float(%pi - mod(%pi, 10      )), return(ans))
(%i4) lastdigits(fnum, lastn):=block([m:rat(fnum), n:lastn, ans], /* it doesn't help when lastn is bigger than the total digits in fnum it returns the whole digits in fnum anyway without erroring! and fnum=%pi stuff works only upto 8 digits cause num(rat(fnum)) has somuch only! */ratprint:false, ratio(num):=block([k, a], ratprint:false, for k:1 thru fpprec do (a:10^k/ratdenom(num), if(integerp(a)) then return(a))), ratepsilon:2.0e-16, bftorat:false,  ans:mod(ratio(fnum)*num(m), (10^n))/(ratio(fnum)*denom(m)), return(float(ans)));
(%o4) lastdigits(fnum, lastn) := block([m : rat(fnum), n : lastn, ans], 
ratprint : false, ratio(num) := block([k, a], ratprint : false, 
                                 k
                               10
for k thru fpprec do (a : -------------, if integerp(a) then return(a))), 
                          ratdenom(num)
                                                                       n
                                             mod(ratio(fnum) num(m), 10 )
ratepsilon : 2.0E-16, bftorat : false, ans : ----------------------------, 
                                                 ratio(fnum) denom(m)
return(float(ans)))
(%i5) lastdigits(4.1459, 5);
(%o5)                          4.14590001103631
(%i6) lastdigits(3.1459, 3);
(%o6)                               0.0459
(%i7) b:pidigits(5);
(%o7)                               3.14159
(%i8) lastdigits(3.14159, 3);
(%o8)                               0.00159
(%i9) lastdigits(pidigits(5), 3);
(%o9)                               0.00159
(%i10) pidigits(6);
(%o10)                             3.141592
(%i11) lastdigits(pidigits(6), 3);
(%o11)                       5.9199999999999997E-4
(%i12) lastdigits(4.14592, 3);
(%o12)                              0.00592
(%i13) lastdigits(b, 3);
(%o13)                              0.00159
(%i14) a:[0, float(%pi)];
(%o14)                      [0, 3.141592653589793]
(%i15) a;
(%o15)                      [0, 3.141592653589793]
(%i16) delete(pidigits(16), a);
(%o16)                                [0]
(%i17) delete(pidigits(fpprec), a);
(%o17)                                [0]
(%i18) delete(pidigits(fpprec), [0, float(%pi)]);
(%o18)                                [0]
(%i19) intervals(items, [granul]):=block([ start:first(items), stop:last(items), ans:[], granul:(if not(emptyp(granul)) then first(granul) else 1) ], ratprint:false, if (emptyp(items)) then [] elseif(listp(items)) then    if(emptyp(rest(items))) then []     else     while(float(rat(start))<
float(rat(stop))) do    (ans:delete([],             delete([float(rat(stop)), float(rat(stop+granul))],             if(float(rat(start+granul))>
float(rat(stop)))            then return() else            append(ans, [cons(float(rat(start)),  [float(rat(start+granul))])]))),      start:float(rat(start+granul))),     return(ans));
(%o19) intervals(items, [granul]) := block([start : first(items), 
stop : last(items), ans : [], granul : 
if not emptyp(granul) then first(granul) else 1], ratprint : false, 
if emptyp(items) then [] elseif listp(items)
 then (if emptyp(rest(items)) then [] else (while float(rat(start)) < 
float(rat(stop)) do (ans : delete([], delete([float(rat(stop)), 
float(rat(stop + granul))], if float(rat(start + granul)) > float(rat(stop))
 then return() else append(ans, [cons(float(rat(start)), 
[float(rat(start + granul))])]))), start : float(rat(start + granul))))), 
return(ans))
(%i20) intervals([0, 2*%pi], %pi);
(%o20) [[0.0, 3.141592653589793], [3.141592653589793, 6.283185307179585]]
(%i21) delete(pidigits(fpprec), intervals([0, 2*%pi], %pi));
(%o21) [[0.0, 3.141592653589793], [3.141592653589793, 6.283185307179585]]
(%i22) 
[addcol,bfloat,echelon,fpprec,fpprintprec,load,matrix,rowop] [bern,bfloat,block,fpprec,makelist,numer,return,sum] [bfloat,bftorat,block,emptyp,equal,first,fpprec,if,is,mod,not,numer,ratepsilon,ratprint,return,round] [bfloat,bftorat,block,emptyp,first,fpprec,if,mod,not,numer,ratepsilon,ratprint,return] [bfloat,block,floor,fpprec,print,sign,sum,while] [bfloat,block,floor,fpprec,sign,sum,while] [bfloat,cos,false,fpprec,numer,ratepsilon,sin,solve] [bfloat,cos,fpprec,linsolve,numer,ratepsilon,sin,true] [bfloat,cos,fpprec,pi,product,sqrt] [bfloat,define_variable,disp,do,float,floor,fpprec,sum] [bfloat,define_variable,display,do,float,floor,fpprec,sum] [bfloat,define_variable,float,floor,fpprec,sum] [bfloat,float,fpprec,numer] [bfloat,float,fpprec,pi,rectform,sqrt] [bfloat,float,fpprec,pi,sqrt] [bfloat,float,fpprec,sqrt] [bfloat,float,fpprec] [bfloat,fpprec,fpprintprec] [bfloat,fpprec,grind,makelist] [bfloat,fpprec,log] [bfloat,fpprec,makelist,numer,sum] [bfloat,fpprec,pi,sqrt] [bfloat,fpprec,pi] [bfloat,fpprec,product,sin,sqrt] [bfloat,fpprec,sin] [bfloat,fpprec,solve] [bfloat,fpprec,sqrt] [bfloat,fpprec,sum] [bfloat,fpprec] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,mod,ratepsilon,ratprint,rest,return] [bftorat,block,cons,delete,emptyp,false,first,float2bf,fpprec,if,integerp,kill,lambda,listp,map,mod,ratdenom,ratepsilon,ratprint,rest,return] [bftorat,block,emptyp,equal,first,float,fpprec,if,is,mod,not,numer,ratepsilon,ratprint,return,round] [bftorat,block,emptyp,first,float,fpprec,if,integerp,mod,not,numer,ratepsilon,ratprint,return] [bftorat,block,ev,false,float2bf,fpprec,if,integerp,kill,mod,ratdenom,ratepsilon,ratprint,return] [bftorat,block,false,float2bf,fpprec,if,integerp,kill,mod,ratdenom,ratepsilon,ratprint,return] [bftorat,block,float2bf,fpprec,if,integerp,mod,ratdenom,ratepsilon,ratprint,return] [block,display,fpprec,fpprintprec,jacobi,printf,return] [block,display,fpprec,fpprintprec,return] [float,fpprec,fpprintprec] [float,fpprec,numer] [float,fpprec,solve] [float,fpprec,sqrt] [float,fpprec] [fpprec,fpprintprec,linsolve,matrix] [fpprec,fpprintprec] [fpprec,numer] [fpprec,plot2d,sin] [fpprec,rat] [fpprec,solve] [fpprec]

Related Help

Help for Fpprec