Mathematica基础——数值转化

2025-04-07 21:53:05

1、首先给出圆周率π。

Mathematica基础——数值转化

2、然后计算π的近似数形态:Pi//N

Mathematica基础——数值转化

3、再提高Pi的精度:Table[N[Pi,n],{n,10,100,10}]

Mathematica基础——数值转化

4、把π转化为有理分式的形态:Rationalize[3.141592]但,有时候也会失败!

Mathematica基础——数值转化
Mathematica基础——数值转化

5、若需要提高精度,可以这样:Rationalize[Pi, 10^-100]误差少于10^-100。

Mathematica基础——数值转化
Mathematica基础——数值转化
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢