Boost logo

Boost Users :

Subject: Re: [Boost-users] Questions about Boost.Multiprecision..
From: John Maddock (jz.maddock_at_[hidden])
Date: 2018-12-20 17:41:31

On 20/12/2018 02:08, A Z via Boost-users wrote:
> I want to be performing some algebraic functions
> work on
> |cpp_rational|
> which I will be using templates with the following type
> to configure precision (and scale?)
> |#include <boost/multiprecision/cpp_int.hpp>|
> in order to avoid the use of floating point types.
> --What is the #include statement for cpp_rational?  I can't manage
> to find it.

It's right at the top of

It's all in

#include <boost/multiprecision/cpp_int.hpp>

> -When using non-floating point, is there a method to obtain
> a variable precision pi, or do I have to use

We've been through this before - cpp_rational is an *exact* type, it
absolutely does not do irrational numbers, much less transcendental
ones.  The clue is in the name.

If you need pi, then you need floating point.


This email has been checked for viruses by Avast antivirus software.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at