Scratch
> | evalf(1020/2598960); |
> |
> | rndto(0.2,places=1),rndto(0.4,places=1),rndto(0.08,places=2); |
> | rndto(0.64,places=2); |
> |
> | rndto(54912/2598960,places=6); |
> | rndto(64/combinat[numbcomb](50,3),places=6); |
> | combinat[numbcomb](50,3); |
> |
> |
> |
> | ###roundto rndto:=proc(x) local top,j, temp,n,ans,ARGS,defaults,Args,Places: defaults:=places=3: Args:=seq([args][j],j=2..nargs): ARGS:=PARAMS([defaults],[Args])[1]: Places:=subs(ARGS,places): temp:=evalf(10^(Places)*x): top:=convert(abs(round(temp)),symbol): n:=length(top): if n <= Places then ans:=cat(`0.`,seq(`0`,j=1..Places-n),top): else ans:=cat(substring(top,1.. (length(top)-Places)),`.`,substring(top,-Places..-1)): fi: if evalf(x)<0 then ans:=cat(`-`,ans): fi: if (parse(ans)=0) then ans:=cat(`.`,seq(`0`,j=1..Places)): fi: ans: end: ###end roundto |
> |
> |
Setup (Needed for running Maple, not for viewing!).
> |
> |
> |
> |