From a7731263bcc35ff401b9d8fd9b4cd648eb890192 Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Sat, 12 Jul 2025 21:07:16 +0200 Subject: [PATCH] More docs improvements --- README.md | 5 +++- doc/tutorial.qbk | 3 ++ doc/tutorial_boost_rational.qbk | 50 --------------------------------- doc/tutorial_debug_adaptor.qbk | 8 +----- doc/tutorial_misc_backends.qbk | 1 - doc/tutorial_rational.qbk | 1 - 6 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 doc/tutorial_boost_rational.qbk diff --git a/README.md b/README.md index b1051d73..18db904a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ requiring extended range and precision. Multiprecision consists of a generic interface to the mathematics of large numbers as well as a selection of big number backends. -This includes interfaces to GMP, MPFR, MPIR and TomMath +These include interfaces to GMP, MPFR, MPIR and TomMath and also Multiprecision's own collection of Boost-licensed, header-only backends for integers, rationals, floats and complex-floats. @@ -42,6 +42,9 @@ This usually provides better performance than using types configured without exp The full documentation is available on [boost.org](http://www.boost.org/doc/libs/release/libs/multiprecision/index.html). +A practical, comprehensive, instructive, clear and very helpful video regarding the use of Multiprecision +can be found [here](https://www.youtube.com/watch?v=mK4WjpvLj4c). + ## Using Multiprecision

diff --git a/doc/tutorial.qbk b/doc/tutorial.qbk index 9011dc25..a9deff5a 100644 --- a/doc/tutorial.qbk +++ b/doc/tutorial.qbk @@ -16,6 +16,9 @@ In order to use this library you need to make two choices: [link boost_multiprecision.tut.floats floating-point], [link boost_multiprecision.tut.rational rational], or [link boost_multiprecision.tut.complex complex]). * Which back-end do I want to perform the actual arithmetic (Boost-supplied, GMP, MPFR, MPC, Tommath etc)? +A practical, comprehensive, instructive, clear and very helpful video regarding the use of Multiprecision +can be found [@https://www.youtube.com/watch?v=mK4WjpvLj4c here]. + [include tutorial_integer.qbk] [include tutorial_floats.qbk] [include tutorial_interval_mpfi.qbk] diff --git a/doc/tutorial_boost_rational.qbk b/doc/tutorial_boost_rational.qbk deleted file mode 100644 index af54bc2b..00000000 --- a/doc/tutorial_boost_rational.qbk +++ /dev/null @@ -1,50 +0,0 @@ -[/ - Copyright 2011 - 2020 John Maddock. - Copyright 2013 - 2019 Paul A. Bristow. - Copyright 2013 Christopher Kormanyos. - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt). -] - -[section:tommath_rational tommath_rational] - -`#include ` - - namespace boost{ namespace multiprecision{ - - typedef rational_adpater tommath_rational; - typedef number tom_rational; - - }} // namespaces - -The `tommath_rational` back-end is used via the typedef `boost::multiprecision::tom_rational`. It acts as a thin wrapper around -`boost::rational` -to provide a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision. - -The advantage of using this type rather than `boost::rational` directly, is that it is expression-template enabled, -greatly reducing the number of temporaries created in complex expressions. - -There are also non-member functions: - - tom_int numerator(const tom_rational&); - tom_int denominator(const tom_rational&); - -which return the numerator and denominator of the number. - -Things you should know when using this type: - -* Default constructed `tom_rational`s have the value zero (this the inherited Boost.Rational behavior). -* Division by zero results in a `std::overflow_error` being thrown. -* Conversion from a string results in a `std::runtime_error` being thrown if the string can not be -interpreted as a valid rational number. -* No changes are made to [tommath]'s global state, so this type can safely coexist with other [tommath] code. -* Performance of this type has been found to be pretty poor - this need further investigation - but it appears that Boost.Rational -needs some improvement in this area. - -[h5 Example:] - -[mp_rat_eg] - -[endsect] [/section:tommath_rational tommath_rational] diff --git a/doc/tutorial_debug_adaptor.qbk b/doc/tutorial_debug_adaptor.qbk index c9114a6e..55de94a3 100644 --- a/doc/tutorial_debug_adaptor.qbk +++ b/doc/tutorial_debug_adaptor.qbk @@ -32,13 +32,7 @@ multiprecision values can easily be inspected in the debugger by looking at the The down side of this approach is that runtimes are much slower when using this type. Set against that it can make debugging very much easier, certainly much easier than sprinkling code with `printf` statements. -When used in conjunction with the Visual C++ debugger visualisers, the value of a multiprecision type that uses this -backend is displayed in the debugger just a __fundamental value would be, here we're inspecting a value of type -`number > >`: - -[$../debugger1.png] - -Otherwise you will need to expand out the view and look at the "debug_value" member: +You will need to expand out the view and look at the "debug_value" member: [$../debugger2.png] diff --git a/doc/tutorial_misc_backends.qbk b/doc/tutorial_misc_backends.qbk index 827e02ab..d4110fc6 100644 --- a/doc/tutorial_misc_backends.qbk +++ b/doc/tutorial_misc_backends.qbk @@ -14,6 +14,5 @@ Backend types listed in this section are predominantly designed to aid debugging [include tutorial_logged_adaptor.qbk] [include tutorial_debug_adaptor.qbk] -[include tutorial_visualizers.qbk] [endsect] [/section:misc Miscellaneous Number Types.] diff --git a/doc/tutorial_rational.qbk b/doc/tutorial_rational.qbk index 2f592cad..022b4571 100644 --- a/doc/tutorial_rational.qbk +++ b/doc/tutorial_rational.qbk @@ -24,7 +24,6 @@ The following back-ends provide rational number arithmetic: [include tutorial_cpp_rational.qbk] [include tutorial_gmp_rational.qbk] [include tutorial_tommath_rational.qbk] -[include tutorial_boost_rational.qbk] [include tutorial_rational_adaptor.qbk] [endsect] [/section:rational Rational Number Types]