如何处理tcl中的大整数(64位)数?(How to handle big integers (64 bit) numbers in tcl?)

编程入门 行业动态 更新时间:2024-10-25 14:24:02
如何处理tcl中的大整数(64位)数?(How to handle big integers (64 bit) numbers in tcl?)

在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.

更多推荐

本文发布于:2023-07-23 18:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1235575.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:整数   如何处理   handle   tcl   integers

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!