math - How to approximate a number to a n number of decimal places? -
i have started using maxima
few weeks ago (actually have used few times) wxmaxima
interface os x.
i have tried find solution around web, maybe because blind or maybe because not have experience in searching in official documentation of maxima, have not find concrete solution yet.
how approximate number n
number of decimal places? example, if use float(22/7)
, gives me huge number 3.142857142857143
, want example approximate 3rd decimal place 3.143
.
fpprec
controls actual number of significant digits in maxima bigfloat. applies bigfloats , not ordinary (fixed precision, ieee 754) floats.
see fpprintprec
controls how many digits printed, applies bigfloats , ordinary floats alike. solution is:
(%i1) fpprintprec : 4 $ (%i2) float (22/7); (%o2) 3.143
Comments
Post a Comment