在expr命令中处理大整数的最佳方法是什么? 我们知道expr广泛。
what is the best way to handle big integers in expr command. we know wide in expr.
最满意答案
从Tcl 8.5开始,整数现在是Bignums(任意精度)
如果您使用的是旧版本(您说过的是8.4.x),则需要考虑使用这些数字所需的内容。 大多数标准命令都不接受Bignums,因为当时它还没有被添加到核心。 但是,如果你只是用它们做数学,你可能想看一看
tcllib包 ,它有一个用于任意精度数学的库,或者 mexpr包 。最后,值得在Tclers Wiki上搜索其他选项。
As of Tcl 8.5, integers are now Bignums (arbitrary precision)
If you're using an older version (which you've said you are, 8.4.x), you'll need to consider what you need to use the numbers for. Most of the standard commands won't accept Bignums, since it hadn't been added to the core at that time. However, if you're just doing math with them, you might want to take a look at
the tcllib package, which has a library for arbitrary precision math, or the mexpr package.Lastly, it's worth searching the Tclers Wiki for other options.
更多推荐
发布评论