C中的BigInteger? [英] BigInteger in C?
问题描述
在 C 中处理大量数字的最简单方法是什么?我需要将值存储在区域 1000^900
中,或者以更易读的形式 10^2700
.
What is the easiest way to handle huge numbers in C? I need to store values in the Area 1000^900
, or in more human readable form 10^2700
.
有人知道一种简单的方法吗?任何帮助将不胜感激!
Does anybody know of an easy way to do that? Any help would really be appreciated!
推荐答案
使用 libgmp:
GMP 是一个用于任意精度算术的免费库,可对有符号整数、有理数和浮点数进行运算.除了机器 GMP 运行中的可用内存所暗示的精度之外,对精度没有实际限制...
GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on...
自第 6 版起,GMP 在双重许可下分发,GNU LGPL v3 和GNU GPL v2...
Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2...
GMP 的主要目标平台是 Unix 类型的系统,例如 GNU/Linux、Solaris、HP-UX、Mac OS X/Darwin、BSD、AIX 等.众所周知,它还可以在 32 位的 Windows 上运行和 64 位模式...
GMP's main target platforms are Unix-type systems, such as GNU/Linux, Solaris, HP-UX, Mac OS X/Darwin, BSD, AIX, etc. It also is known to work on Windows in both 32-bit and 64-bit mode...
这篇关于C中的BigInteger?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!