Boost logo

Boost Users :

Subject: Re: [Boost-users] Cannot compile with multiprecision :: eval_*()functions
From: Anderson Lebowski (apartment.26688_at_[hidden])
Date: 2014-01-21 01:14:17


looks like I went to the wrong track. Yes, merely the pow function works.
Thank you very much!

On Mon, Jan 20, 2014 at 8:42 AM, John Maddock <john_at_[hidden]>wrote:

> I am trying to use eval_pow() and eval_powm()
>>
>
> Those are internal details, you shouldn't really be using them in user
> code.
>
>
> My code is like this and I am using Visual Studio 12:
>>
>> #include <boost/multiprecision/cpp_int.hpp>
>> ...
>> boost::multiprecision::cpp_int pow("1234567");
>> boost::multiprecision::cpp_int base(3);
>> boost::multiprecision::cpp_int result = 0;
>>
>> boost::multiprecision::default_ops::eval_pow(result, base, pow);
>>
>> I cannot figure out what's going on wrong when I compile it, the error
>> message is like the following, Can anyone shed some light please?
>>
>
> The eval_* functions take *Backends* and not *numbers* as arguments.
>
> In any case there is (deliberately) no integer pow function which accepts
> an arbitrary precision exponent value - even 2^INT_MAX would run the
> machine out of memory in a trice.
>
> What's wrong with:
>
> result = pow(base, 1234567);
>
> and let the expression template code handle memory management?
>
> John.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net