123456789 发表于 2024-1-14 11:11:17

怎么样在VC++6里面使用MPFR

忘记问另外一个问题了。
MPFR与GMP有什么不同啊,看不懂英文。哪个更加快点?哪个更加容易使用啊?
如果MPFR好用,希望有大牛教我一下怎么用MPFR。
唉,天天被密码搞得头晕啊。
matlab怎么不支持高精度整数啊,搞得我做密码实验还要跑到VC去,加完密还要再跑到matlab来,不知要怎么办!头快爆炸了。

PS:matlab要怎么样才读取GMP计算出来结果(全是大整数)啊?

谢谢各位大牛了。

isotaztiqotew 发表于 2024-1-14 11:11:45

matlab 支持高精度整数。

aecupeemow 发表于 2024-1-14 11:12:12

Are you sure?
我怎么找不到呢?
要怎么样才能用啊?用哪个函数?

ulenkusefihj 发表于 2024-1-14 11:12:22

比如:
>> vpa('(1+sqrt(5))/2',20)

相关参考:
>> help vpa
VPA    Variable precision arithmetic.
    R = VPA(S) numerically evaluates each element of the double matrix
    S using variable precision floating point arithmetic with D decimal
    digit accuracy, where D is the current setting of DIGITS.
    The resulting R is a SYM.

    VPA(S,D) uses D digits, instead of the current setting of DIGITS.
    D is an integer or the SYM representation of a number.

    It is important to avoid the evaluation of an expression using double
    precision floating point arithmetic before it is passed to VPA.
    For example,
       phi = vpa((1+sqrt(5))/2)
    first computes a 16-digit approximation to the golden ratio, then
    converts that approximation to one with d digits, where d is the current
    setting of DIGITS.To get full precision, use unevaluated string or
    symbolic arguments,
       phi = vpa('(1+sqrt(5))/2')
    or
       s = sym('sqrt(5)')
       phi = vpa((1+s)/2);

    Additional examples:
       vpa(pi,780) shows six consecutive 9's near digit 770 in the
          decimal expansion of pi.

       vpa(hilb(2),5) returns

          [    1., .50000]
          [.50000, .33333]

    See also double, digits.

agihaku 发表于 2024-1-14 11:13:03

可是如果我是要编一个加密算法,涉及到几千比特的整数的模加,模乘时,还能用vpa吗?

ifequwu 发表于 2024-1-14 11:13:38

2# G-Spider
准确地说,matlab7用gmp作为大数运算的内核。
向量、矩阵等运算用到atlas 、mkl、ipp、lapack等。
FFT用fftw3。
...

jnetoji 发表于 2024-1-14 11:13:58

可以试试这个工具箱:
http://www.mathworks.com/matlabc ... -toolbox-for-matlab

http://www.thedigitalmap.com/~carlos/software/index.htm
页: [1]
查看完整版本: 怎么样在VC++6里面使用MPFR