Skip to content

Commit

Permalink
Merge pull request #252 from bluescarni/pr/real_tut
Browse files Browse the repository at this point in the history
Real tutorial
  • Loading branch information
bluescarni committed Jun 12, 2020
2 parents 375703e + a05df63 commit 4785a4a
Show file tree
Hide file tree
Showing 7 changed files with 632 additions and 9 deletions.
7 changes: 6 additions & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ Changelog
New
~~~

- Add a tutorial for :cpp:class:`~mppp::real`
(`#252 <https://github.com/bluescarni/mppp/pull/252>`__).
- Expose all the constants provided by MPFR in the
:cpp:class:`~mppp::real` API
(`#252 <https://github.com/bluescarni/mppp/pull/252>`__).
- Add the :cpp:class:`~mppp::integer` LCM primitives
(`#247 <https://github.com/bluescarni/mppp/pull/247>`__).
- Additional special functions for :cpp:class:`~mppp::complex`
- Implement additional special functions for :cpp:class:`~mppp::complex`
(inverse, reciprocal square root, n-th root, AGM)
(`#250 <https://github.com/bluescarni/mppp/pull/250>`__,
`#246 <https://github.com/bluescarni/mppp/pull/246>`__).
Expand Down
36 changes: 30 additions & 6 deletions doc/real.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2767,25 +2767,49 @@ Constants
---------

.. cpp:function:: mppp::real mppp::real_pi(mpfr_prec_t p)
.. cpp:function:: mppp::real mppp::real_log2(mpfr_prec_t p)
.. cpp:function:: mppp::real mppp::real_euler(mpfr_prec_t p)
.. cpp:function:: mppp::real mppp::real_catalan(mpfr_prec_t p)

:math:`\pi` constant.
These functions will return, respectively:

* the :math:`\pi` constant,
* the :math:`\log 2` constant,
* the Euler-Mascheroni constant (0.577…),
* Catalan's constant (0.915…),

This function will return a :cpp:class:`~mppp::real` :math:`\pi`
with a precision of *p*.

.. versionadded:: 0.21

The ``real_log2()``, ``real_euler()`` and ``real_catalan()``
functions.

:param p: the desired precision.

:return: an approximation of :math:`\pi`.
:return: an approximation of a constant.

:exception std\:\:invalid_argument: if *p* is outside the range established by
:cpp:func:`mppp::real_prec_min()` and :cpp:func:`mppp::real_prec_max()`.

.. cpp:function:: mppp::real &mppp::real_pi(mppp::real &rop)
.. cpp:function:: mppp::real &mppp::real_log2(mppp::real &rop)
.. cpp:function:: mppp::real &mppp::real_euler(mppp::real &rop)
.. cpp:function:: mppp::real &mppp::real_catalan(mppp::real &rop)

Set to :math:`\pi`.
These functions will set *rop* to, respectively:

* the :math:`\pi` constant,
* the :math:`\log 2` constant,
* the Euler-Mascheroni constant (0.577…),
* Catalan's constant (0.915…).

The precision of *rop* will not be altered.

This function will set *rop* to :math:`\pi`. The precision
of *rop* will not be altered.
.. versionadded:: 0.21

The ``real_log2()``, ``real_euler()`` and ``real_catalan()``
functions.

:param rop: the return value.

Expand Down
2 changes: 2 additions & 0 deletions doc/tutorial_constr.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _tutorial_constr:

Construction, conversion and assignment
---------------------------------------

Expand Down

0 comments on commit 4785a4a

Please sign in to comment.