@@ -1555,24 +1555,34 @@ Arithmetic
15551555 :return: :math: `-x`.
15561556
15571557.. cpp :function :: template <mppp::cvr_real T> mppp::real &mppp::abs (mppp::real &rop, T &&x)
1558+ .. cpp :function :: template <mppp::cvr_real T> mppp::real &mppp::fabs (mppp::real &rop, T &&x)
15581559
15591560 Binary :cpp:class: `~mppp::real ` absolute value.
15601561
1561- This function will set *rop * to :math: `\left | x \right |`. The precision of the result will be
1562+ These functions will set *rop * to :math: `\left | x \right |`. The precision of the result will be
15621563 equal to the precision of *x *.
15631564
1565+ .. versionadded :: 0.27
1566+
1567+ The ``fabs() `` overload.
1568+
15641569 :param rop: the return value.
15651570 :param x: the operand.
15661571
15671572 :return: a reference to *rop *.
15681573
15691574.. cpp :function :: template <mppp::cvr_real T> mppp::real mppp::abs (T &&x)
1575+ .. cpp :function :: template <mppp::cvr_real T> mppp::real mppp::fabs (T &&x)
15701576
15711577 Unary :cpp:class: `~mppp::real ` absolute value.
15721578
1573- This function will return :math: `\left | x \right |`. The precision of the result will be
1579+ These functions will return :math: `\left | x \right |`. The precision of the result will be
15741580 equal to the precision of *x *.
15751581
1582+ .. versionadded :: 0.27
1583+
1584+ The ``fabs() `` overload.
1585+
15761586 :param x: the operand.
15771587
15781588 :return: :math: `\left | x \right |`.
@@ -1685,8 +1695,11 @@ Comparison
16851695~~~~~~~~~~
16861696
16871697.. cpp :function :: bool mppp::nan_p (const mppp::real &r)
1698+ .. cpp :function :: bool mppp::isnan (const mppp::real &r)
16881699.. cpp :function :: bool mppp::inf_p (const mppp::real &r)
1700+ .. cpp :function :: bool mppp::isinf (const mppp::real &r)
16891701.. cpp :function :: bool mppp::number_p (const mppp::real &r)
1702+ .. cpp :function :: bool mppp::isfinite (const mppp::real &r)
16901703.. cpp :function :: bool mppp::zero_p (const mppp::real &r)
16911704.. cpp :function :: bool mppp::regular_p (const mppp::real &r)
16921705.. cpp :function :: bool mppp::integer_p (const mppp::real &r)
@@ -1696,16 +1709,20 @@ Comparison
16961709
16971710 These functions will return ``true `` if *r * is, respectively:
16981711
1699- * NaN,
1700- * an infinity,
1701- * a finite number,
1702- * zero,
1703- * a regular number (i.e., not NaN, infinity or zero),
1704- * an integral value,
1705- * one,
1712+ * NaN (`` nan_p() `` and `` isnan() ``) ,
1713+ * an infinity (`` inf_p() `` and `` isinf() ``) ,
1714+ * a finite number (`` number_p() `` and `` isfinite() ``) ,
1715+ * zero (`` zero_p() ``) ,
1716+ * a regular number (i.e., not NaN, infinity or zero) (`` regular_p() ``) ,
1717+ * an integral value (`` integer_p() ``) ,
1718+ * one (`` is_one() ``) ,
17061719
17071720 ``false `` otherwise.
17081721
1722+ .. versionadded :: 0.27
1723+
1724+ The ``isnan() ``, ``isinf() `` and ``isfinite() `` overloads.
1725+
17091726 :param r: the input argument.
17101727
17111728 :return: the result of the detection.
@@ -3184,6 +3201,21 @@ Serialisation
31843201
31853202 :exception unspecified: any exception thrown by the invoked :cpp:func: `mppp::real::binary_load() ` overload.
31863203
3204+ Other
3205+ ~~~~~
3206+
3207+ .. cpp :function :: std::size_t mppp::hash (const mppp::real &x)
3208+
3209+ .. versionadded :: 0.27
3210+
3211+ Hash function for :cpp:class: `~mppp::real `.
3212+
3213+ This function guarantees that ``x == y `` implies ``hash(x) == hash(y) ``.
3214+
3215+ :param x: the argument.
3216+
3217+ :return: a hash value for *x *.
3218+
31873219.. _real_operators :
31883220
31893221Mathematical operators
@@ -3348,6 +3380,30 @@ Constants
33483380
33493381 :return: a reference to *rop *.
33503382
3383+ Standard library specialisations
3384+ --------------------------------
3385+
3386+ .. cpp :class :: template <> std::hash<mppp::real>
3387+
3388+ .. versionadded :: 0.27
3389+
3390+ Specialisation of ``std::hash `` for :cpp:class: `mppp::real `.
3391+
3392+ The hash is computed via :cpp:func: `std::size_t mppp::hash(const mppp::real &) `.
3393+
3394+ .. cpp :type :: public argument_type = mppp::real
3395+ .. cpp :type :: public result_type = std::size_t
3396+
3397+ .. note ::
3398+
3399+ The :cpp:type: `argument_type ` and :cpp:type: `result_type ` type aliases are defined only until C++14.
3400+
3401+ .. cpp :function :: public std::size_t operator ()(const mppp::real &x) const
3402+
3403+ :param x: the input :cpp:class: `mppp::real `.
3404+
3405+ :return: a hash value for *x *.
3406+
33513407.. _real_literals :
33523408
33533409User-defined literals
0 commit comments