所有人。这是另一个关于pari-gp的快速问题。
我已经编写了我的主文件,以便两个不同的函数在\ps 100或\ps 36时工作得更好;所以我想在运行之前指定一些函数,以便在本地我们可以使用\ps 100或\ps 36。
这样,我想要一个功能类似于localprec的函数--但要具有系列精度,而不是数字精度。这意味着我们可以有这样的东西,
\ps 100
/*....a bunch of code here....*/
my_local_function(var) = {
localserprec(36); /*sets local series precision to 36, only for this function*/
/*bunch of code here....*/
}100系列精度函数从不与36系列精度函数交互,除非降至36。我们从不尝试从36到100,所以应该不会有什么真正的问题。
任何帮助或意见都是非常感谢的。
发布于 2021-08-25 08:18:49
如果我没理解错你的问题,你想要这样的东西:
my_local_function(var, {d=36}) = {
my(old_precision = default(seriesprecision));
default(seriesprecision, d);
/* bunch of your code here.... */
default(seriesprecision, old_precision);
}这将按照您的预期将d设置为仅在本地应用于函数体的系列精度。
https://stackoverflow.com/questions/68916097
复制相似问题