大整数? [英] large integers?
问题描述
全部:
我的一个朋友想要使用大约15位数的整数做一些
计算,据我所知,c99支持long long那个类型
就足够了,但是,很多编译器都不支持很长时间,所以有没有什么其他方法可以解决这个问题。 br />
jackie说:
hi,all:
我的一个朋友想要使用大约15位数的整数做一些
计算,据我所知,c99支持long long和那种类型
就足够了但是,很多编译器都不支持很长时间,因此有任何其他方法可以解决这个问题,例如:
b获得或写出bignum。图书馆。
最常推荐的两个bignum图书馆是Miracl(由Shamus
Software Ltd提供)和GMP。 (通过GNU,不要与GIMP混淆!)。
通过网络搜索很容易找到。我上次看Miracl免费使用非商业性的b $ b使用GMP或GPL覆盖GMP,我忘了
哪个。
>
然而,写你自己很有趣而且很有启发性。
-
Richard Heathfield< http:// www.cpax.org.uk>
电子邮件:-http:// www。 + rjh @
谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>
Usenet是一个奇怪的放置" - dmr 1999年7月29日
问候。
文章
< 24 *** ******** @ j33g2000pri。 googlegroups.com>,
jackie写道:
hi,all:
我的朋友之一想要使用大约15位数的整数做一些
计算,据我所知,c99支持long long和那种类型
就足够了,但是,很多编译器都没有不支持很长时间,所以有没有
解决这个问题的任何其他方法,thx ..
为什么不简单地找到编译器哪个*支持长整数?
你的朋友使用的操作系统如此模糊,比如GCC不是可用的b $ b $
问候,
Tristan
-
_
_V.-o Tristan Miller [en,( fr,de,ia)]><空间有限
/ |` - '' - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =<在ha句中,所以很难
(7_ \\ http://www.nothingisreal.com/ ><完成你的工作
Tristan Miller说:
问候。
文章
< 24 *************** ******************* @ j33g2000pri.googlegroups.com>,
jackie写道:
>全部:
我的一个朋友想要使用大约15位数的整数做一些
计算,据我所知,c99支持long long和那个类型
为什么不简单地找到*支持长整数的编译器?
嗯,公平点 - 但接下来的问题将是哦,它原来我们
毕竟需要40位整数,然后我们减少推荐
,他试图找到一个长期至少为132的编译器
比特宽...
更容易将他指向bignums。 :-)
-
Richard Heathfield< http://www.cpax.org.uk>
电子邮件:-http:// www。 + rjh @
谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>
Usenet是一个奇怪的放置" - dmr 1999年7月29日
hi,all:
one of my pals want to use integers of about 15 digits to do some
calculation,as far as i know,c99 supports long long and that type
would be enough,but,many compiler don''t support long long,so is there
any other way to tackle this problem,thx..解决方案jackie said:
hi,all:
one of my pals want to use integers of about 15 digits to do some
calculation,as far as i know,c99 supports long long and that type
would be enough,but,many compiler don''t support long long,so is there
any other way to tackle this problem,thx..Obtain, or write, a "bignum" library.
The two bignum libraries most commonly recommended are Miracl (by Shamus
Software Ltd) and "GMP" (by GNU, and not to be confused with "GIMP"!).
Either is found easily via a Web search. Miracl was free for non-commercial
use last time I looked, and GMP is covered by either GPL or LGPL, I forget
which.
Writing your own is, however, a lot of fun and rather instructive.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Greetings.
In article
<24**********************************@j33g2000pri. googlegroups.com>,
jackie wrote:
hi,all:
one of my pals want to use integers of about 15 digits to do some
calculation,as far as i know,c99 supports long long and that type
would be enough,but,many compiler don''t support long long,so is there
any other way to tackle this problem,thx..Why not simply find a compiler which *does* support long long integers? Is
your friend using an operating system so obscure that, say, GCC is not
available for it?
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-'' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= < In a haiku, so it''s hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Tristan Miller said:
Greetings.
In article
<24**********************************@j33g2000pri. googlegroups.com>,
jackie wrote:
>hi,all:
one of my pals want to use integers of about 15 digits to do some
calculation,as far as i know,c99 supports long long and that type
would be enough,but,many compiler don''t support long long,so is there
any other way to tackle this problem,thx..
Why not simply find a compiler which *does* support long long integers?Well, fair point - but the next question will then be "oh, it turns out we
need 40-digit integers after all", and then we''re reduced to recommending
that he tries to find a compiler that has long longs that are at least 132
bits wide...
Easier to point him at bignums right off the bat. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
这篇关于大整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!