Questions about Boost multiprecision library.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about Boost multiprecision library.

Boost - Users mailing list
I have some basic startup for use questions pertaining
to the Boost multiprecision library.  I have downloaded
the set of 64 bit .dll files successfully online, and would
like some help points to help me get going.

*I have heard that there are some strange results that
can happen if you are quizzing multiprecision for trigonometry
and try to keep using the double type.  Is this true,
so that I can just kee relying on the std library instead?

-What is the name of the 64 bit windows .dll, or .dll files,
that are the ones for the multiprecision library?

-If I wish to go into arbitrary precision and scale numbers,
what is the type I should use for an integer?  What is the
#include statement I should use, and how do I specify
the number of whole number points and decimal points,
before starting my operations?

-If I wish to go into arbitrary precision and scale numbers,
what is the type I should use for a rational number? What
is the #include statement I should use, and how do I specify
the number of whole number points and decimal points,
before starting my operations?

-For these two types, I wish to do sine, cosine, tangent,
arcsine, arccosine, arctangent, base 10 logarithm,
base e logarithm, power, nth root.  I also want
to obtain pi, but also Euler's constant, to any number
of significang figure or decimal places that I would like.

-If the files are separate for the function support or not,
what are the 64 bit .dll files for this?  What #include statements
should I use?




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Questions about Boost multiprecision library.

Boost - Users mailing list

 

 

From: Boost-users [mailto:[hidden email]] On Behalf Of A Z via Boost-users
Sent: 10 October 2018 02:56
To: [hidden email]
Cc: A Z
Subject: [Boost-users] Questions about Boost multiprecision library.

 

Ø  I have some basic startup for use questions pertaining

to the Boost multiprecision library.  I have downloaded

the set of 64 bit .dll files successfully online, and would

like some help points to help me get going.

 

Boost.Multiprecision is a header-only library, so you should not need to consider any .dll at all.

 

You must install all of Boost as the Getting Started instructions

 

https://www.boost.org/doc/libs/1_68_0/more/getting_started/index.html

 

and then make sure that you can reproduce some of multiprecision examples before you worry about the most detailed questions that you raise.

 

boost\libs\multiprecision\example contains lots of examples that you can rebuild with your favourite tools, Visual studio, *nix, …

 

When you have go that far, I think that you will find many questions answer themselves, or are given in the comprehensive Multiprecision manual

 

https://www.boost.org/doc/libs/1_68_0/libs/multiprecision/doc/html/index.html

 

HTH

 

Paul

 

 

---

Paul A. Bristow

Prizet Farmhouse

Kendal UK LA8 8AB

+44 (0) 1539 561830

 

 

 

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Questions about Boost multiprecision library.

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

> *I have heard that there are some strange results that
> can happen if you are quizzing multiprecision for trigonometry
> and try to keep using the double type.  Is this true,
> so that I can just kee relying on the std library instead?
>

Sorry don't understand the question.

> -What is the name of the 64 bit windows .dll, or .dll files,
> that are the ones for the multiprecision library?
>

There are none - it's header only.

> -If I wish to go into arbitrary precision and scale numbers,
> what is the type I should use for an *integer*?  What is the
> #include statement I should use, and how do I specify
> the number of whole number points and decimal points,
> before starting my operations?

What kind of integer?  Fixed precision or arbitrary precision?

Suggest you start with:

#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::int1024_t;   // fixed precision 1024-bit
integer, or:
using boost::multiprecision::cpp_int;    // arbitrary precision integer

See
https://www.boost.org/doc/libs/1_66_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html 
for other typedefs and examples.

 >and how do I specify the number of whole number points and decimal
points,before starting my operations?

That question makes no sense for integer types.

>
> -If I wish to go into arbitrary precision and scale numbers,
> what is the type I should use for a *rational number*? What
> is the #include statement I should use, and how do I specify
> the number of whole number points and decimal points,
> before starting my operations?

If you want arbitrary precision then try:

#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_rational;    // arbitrary precision
rational

or:

#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>

using boost::multiprecision::int1024_t;   // fixed precision 1024-bit
integer, or:
typedef boost::rational<int1024> rational_1024_t;  // 1024 bit fixed
precision rational

As before your other questions make no sense for these types.

See
https://www.boost.org/doc/libs/1_66_0/libs/multiprecision/doc/html/boost_multiprecision/tut/rational/cpp_rational.html

>
> -For these two types, I wish to do sine, cosine, tangent,
> arcsine, arccosine, arctangent, base 10 logarithm,
> base e logarithm, power, nth root.  I also want
> to obtain pi, but also Euler's constant, to any number
> of significang figure or decimal places that I would like.

Really??? Eulers constant as an integer?  I think you need to re-think
that question.

Best, John.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Questions about Boost multiprecision library.

Boost - Users mailing list
On 11/10/2018 06:22, John Maddock wrote:
>
>  >and how do I specify the number of whole number points and decimal
> points,before starting my operations?
>
> That question makes no sense for integer types.

They're probably asking about fixed-point "integers", not actual integers.

>> -For these two types, I wish to do sine, cosine, tangent,
>> arcsine, arccosine, arctangent, base 10 logarithm,
>> base e logarithm, power, nth root.  I also want
>> to obtain pi, but also Euler's constant, to any number
>> of significang figure or decimal places that I would like.
>
> Really??? Eulers constant as an integer?  I think you need to re-think
> that question.

Fixed-point is generally inappropriate for these sorts of calculations
(or indeed anything beyond basic arithmetic) as it induces too much
rounding error.

Stick to the floating-point types for these sorts of things.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users