最好的bignum库解决C + +欧拉问题? [英] Best bignum library to solve Project Euler problems in C++?

查看:230
本文介绍了最好的bignum库解决C + +欧拉问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还是一个学生,我发现项目欧拉非常有趣。

I am still a student, and I find project Euler very fun.

有时,问题需要大于原始类型的计算。我知道你可以实现它,但我太懒了这样做,

sometimes the question requires calculations that are bigger than primitive types. I know you can implement it but I am too lazy to do this,

所以我尝试了几个库,

MAPM ::性能非常好,但它只提供大的浮点数,可能性检查它是否为整数。非常好接受输入,但讨厌提供输出,并用Visual C ++ 2008 express来编译像魔术。

MAPM :: very good performance, but it provides only big floats, with the possibility to check if it is an integer. very good to accept input, but nasty to provide output, and compiles like magic with Visual C++ 2008 express.

bigint ::一个小的,但需要在很多部分重新工程。使用非常简单,但非常有限的力量,和其他人相比很慢。只有大整数。

bigint :: a small one, but needs a re engineering in many parts. Very simple to use, but very limited power, and very slow compared to others. only big integers.

ttmath ::我最漂亮的一个尝试直到现在!,只是一些文件包括,你有令人难以置信的力量/简单性。编译像魔术在Visual C ++ 2008 express。它很快,因为它提供固定长度的数字。它是使用Metaprogramming在C ++中构建的。我看到的唯一缺点是数字在运行时的长度不是任意的,但是在编写代码时可以有1024K的数字。

ttmath :: the most beautiful one I have tried until now!, just some files to include and you have unbelievable power/simplicity. Compiles like magic in Visual C++ 2008 express. It is fast, because it provides fixed-length numbers. It is built using Metaprogramming in C++. The only disadvantage I see, is that numbers are not arbitrary in length at run-time, but you can have 1024K numbers when writing code very easily,

ttmath::UInt<1024 * 1024> reallyHugeUnsignedInteger;

它提供三种类型:signed,unsigned和float。

It provides three types: signed, unsigned and float.

我试图编译gmp下VC2008 express,但我失败了!我知道这是最好的,但没有哪里容易编译的初学者在VC2008 express,我感谢也如果你指向一个教程编译gmp下VC。

I tried to compile gmp under VC2008 express, but I failed! I know it is the best, but no where easy to compile for a beginner under VC2008 express, I appreciate also if you point to a tutorial to compile gmp under VC.

EDIT ::如果你知道如何使用VC 2008编译gmp,请向我解释并获得赏金:)

EDIT :: If you know how to compile gmp using VC 2008, Please explain to me and get the bounty :)

EITD ::似乎我没有使用正确的术语,所以这里是神奇的GMP Windows!与VC 2008合作:) MPIR

推荐答案

以下是关于GMP和Visual Studio 2008的几个链接:

Here are a couple of links regarding GMP and Visual Studio 2008:

a href =http://www.codeguru.com/forum/showthread.php?t=462096> GMP在CodeGuru安装帮助

GMP Install Help at CodeGuru

< a href =http://www.edgeofnowhere.cc/viewtopic.php?t=393933> GMP Compile Guide at The Edge Of Nowhere (这看起来很彻底)

这篇关于最好的bignum库解决C + +欧拉问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆