Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73608 - in sandbox/big_number: boost/math boost/math/big_number libs/math libs/math/doc libs/math/doc/html libs/math/doc/html/boost_bignumbers libs/math/doc/html/boost_bignumbers/ref libs/math/doc/html/boost_bignumbers/tut libs/math/doc/html/images libs/math/test
From: john_at_[hidden]
Date: 2011-08-08 08:27:48


Author: johnmaddock
Date: 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
New Revision: 73608
URL: http://svn.boost.org/trac/boost/changeset/73608

Log:
Add a few non-member functions for real-valued types.
Add minimal docs.
Added:
   sandbox/big_number/libs/math/Jamroot.jam (contents, props changed)
   sandbox/big_number/libs/math/boost-build.jam (contents, props changed)
   sandbox/big_number/libs/math/doc/
   sandbox/big_number/libs/math/doc/Jamfile.v2 (contents, props changed)
   sandbox/big_number/libs/math/doc/big_number.qbk (contents, props changed)
   sandbox/big_number/libs/math/doc/html/
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/intro.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/backendconc.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/bignum.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/ints.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/reals.html (contents, props changed)
   sandbox/big_number/libs/math/doc/html/boostbook.css
      - copied unchanged from r73376, /sandbox/tools/auto_index/doc/html/boostbook.css
   sandbox/big_number/libs/math/doc/html/images/
      - copied from r73376, /sandbox/tools/auto_index/doc/html/images/
   sandbox/big_number/libs/math/doc/html/index.html (contents, props changed)
Text files modified:
   sandbox/big_number/boost/math/big_number.hpp | 49 ++++++++++++++++++++++++++++++++++++++++
   sandbox/big_number/boost/math/big_number/gmp.hpp | 48 +++++++++++++++++++++++++++++++++++++++
   sandbox/big_number/libs/math/test/test_arithmetic.cpp | 23 ++++++++++++++++++
   3 files changed, 120 insertions(+), 0 deletions(-)

Modified: sandbox/big_number/boost/math/big_number.hpp
==============================================================================
--- sandbox/big_number/boost/math/big_number.hpp (original)
+++ sandbox/big_number/boost/math/big_number.hpp 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -398,6 +398,14 @@
    {
       return m_backend.compare(canonical_value(o));
    }
+ Backend& backend()
+ {
+ return m_backend;
+ }
+ const Backend& backend()const
+ {
+ return m_backend;
+ }
 private:
    template <class Exp>
    void do_assign(const Exp& e, const proto::tag::unary_plus&)
@@ -1160,6 +1168,47 @@
    return is;
 }
 
+//
+// Non-member functions accepting an expression-template as argument:
+//
+#undef sqrt
+template <class Exp>
+typename boost::math::detail::expression_type<Exp>::type sqrt(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return sqrt(result_type(val));
+}
+template <class Exp>
+typename detail::expression_type<Exp>::type abs(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return abs(result_type(val));
+}
+template <class Exp>
+typename detail::expression_type<Exp>::type fabs(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return fabs(result_type(val));
+}
+template <class Exp>
+typename detail::expression_type<Exp>::type ceil(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return ceil(result_type(val));
+}
+template <class Exp>
+typename detail::expression_type<Exp>::type floor(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return floor(result_type(val));
+}
+template <class Exp>
+typename detail::expression_type<Exp>::type trunc(const detail::big_number_exp<Exp>& val)
+{
+ typedef typename detail::expression_type<Exp>::type result_type;
+ return trunc(result_type(val));
+}
+
 }} // namespaces
 
 #endif

Modified: sandbox/big_number/boost/math/big_number/gmp.hpp
==============================================================================
--- sandbox/big_number/boost/math/big_number/gmp.hpp (original)
+++ sandbox/big_number/boost/math/big_number/gmp.hpp 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -283,6 +283,8 @@
       d = v;
       return compare(d);
    }
+ mpf_t& data() { return m_data; }
+ const mpf_t& data()const { return m_data; }
 protected:
    mpf_t m_data;
 };
@@ -366,6 +368,52 @@
    }
 };
 
+//
+// Native non-member operations:
+//
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > sqrt(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_sqrt(result.backend().data(), val.backend().data());
+ return result;
+}
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > abs(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_abs(result.backend().data(), val.backend().data());
+ return result;
+}
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > fabs(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_abs(result.backend().data(), val.backend().data());
+ return result;
+}
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > ceil(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_ceil(result.backend().data(), val.backend().data());
+ return result;
+}
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > floor(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_floor(result.backend().data(), val.backend().data());
+ return result;
+}
+template <unsigned Digits10>
+big_number<gmp_real<Digits10> > trunc(const big_number<gmp_real<Digits10> >& val)
+{
+ big_number<gmp_real<Digits10> > result;
+ mpf_trunc(result.backend().data(), val.backend().data());
+ return result;
+}
+
 struct gmp_int
 {
    typedef mpl::list<long, long long> signed_types;

Added: sandbox/big_number/libs/math/Jamroot.jam
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/Jamroot.jam 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,9 @@
+
+import modules ;
+
+local boost = [ modules.peek : BOOST ] ;
+
+project sandbox : requirements <include>$(boost) ;
+
+# This seems to prevent some Boost.Build errors that otherwise occur :-(
+use-project /boost : $(boost) ;

Added: sandbox/big_number/libs/math/boost-build.jam
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/boost-build.jam 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,72 @@
+# Copyright Rene Rivera 2007.
+#
+# 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)
+
+# For instructions see Jamfile.v2, or "bjam --help".
+
+local rule if-has-file ( file + : dir * )
+{
+ local result ;
+ if $(dir)
+ {
+ result = [ GLOB $(dir) : $(file) ] ;
+ }
+ return $(result[1]:P) ;
+}
+
+#~ Attempts to find the Boost source tree...
+
+local boost-src = [ if-has-file LICENSE_1_0.txt :
+ [ MATCH --boost=(.*) : $(ARGV) ]
+ $(BOOST)
+ $(BOOST_ROOT)
+ $(.boost-build-file:D)/../boost
+ $(.boost-build-file:D)/../Trunk
+ ] ;
+
+# error handling:
+if ! $(boost-src)
+{
+ ECHO Unable to find the Boost source tree in the locations searched. ;
+ ECHO Try setting the environment variable BOOST to point to your ;
+ ECHO Boost tree, or else invoke bjam with the --boost=path option. ;
+ ECHO The Boost include path will not be automatically set. ;
+ ECHO The paths searched were [ MATCH --boost=(.*) : $(ARGV) ] $(BOOST) $(.boost-build-file:D)/../boost $(.boost-build-file:D)/../Trunk ;
+ ECHO But the file LICENSE_1_0.txt was not found in any of them ;
+}
+
+#~ Attempts to find the Boost.Build files...
+
+local boost-build-src = [ if-has-file bootstrap.jam :
+ [ MATCH --boost-build=(.*) : $(ARGV) ]
+ $(BOOST_BUILD_PATH)
+ $(BOOST_BUILD)
+ $(boost-src)/tools/build/v2
+ ] ;
+
+# error handling:
+if ! $(boost-build-src)
+{
+ ECHO Unable to find the Boost.Build source tree in the locations searched. ;
+ ECHO Try setting the environment variable BOOST_BUILD to point to your ;
+ ECHO Boost.Build tree, or else invoke bjam with the --boost-build=path option. ;
+ ECHO The paths searched were [ MATCH --boost-build=(.*) : $(ARGV) ] $(BOOST_BUILD_PATH) $(BOOST_BUILD) $(boost-src)/tools/build/v2 ;
+ ECHO But bootstrap.jam was not found in any of these ;
+ ECHO More failures will very likely follow... ;
+}
+
+#~ Set some common vars to refer to the Boost sources...
+
+BOOST ?= $(boost-src) ;
+BOOST_ROOT ?= $(boost-src) ;
+
+#~ And load up Boost.Build...
+
+boost-build $(boost-build-src) ;
+
+
+
+
+

Added: sandbox/big_number/libs/math/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/Jamfile.v2 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,67 @@
+
+# Copyright John Maddock 2011. Use, modification, and distribution are
+# subject to 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)
+
+using quickbook ;
+
+path-constant images_location : html ;
+
+xml big_number : big_number.qbk ;
+boostbook standalone
+ :
+ big_number
+ :
+ # Path for links to Boost:
+ #<xsl:param>boost.root=../../../../..
+
+ # Some general style settings:
+ <xsl:param>table.footnote.number.format=1
+ <xsl:param>footnote.number.format=1
+ <xsl:param>html.stylesheet=boostbook.css
+
+ # HTML options first:
+ # Use graphics not text for navigation:
+ <xsl:param>navig.graphics=1
+ # How far down we chunk nested sections, basically all of them:
+ <xsl:param>chunk.section.depth=10
+ # Don't put the first section on the same page as the TOC:
+ <xsl:param>chunk.first.sections=10
+ # How far down sections get TOC's
+ <xsl:param>toc.section.depth=10
+ # Max depth in each TOC:
+ <xsl:param>toc.max.depth=4
+ # How far down we go with TOC's
+ #<xsl:param>generate.section.toc.level=10
+ # Index on type:
+ <xsl:param>index.on.type=1
+
+ # PDF Options:
+ # TOC Generation: this is needed for FOP-0.9 and later:
+ <xsl:param>fop1.extensions=0
+ <format>pdf:<xsl:param>xep.extensions=1
+ # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
+ <format>pdf:<xsl:param>fop.extensions=0
+ <format>pdf:<xsl:param>fop1.extensions=0
+ # No indent on body text:
+ <format>pdf:<xsl:param>body.start.indent=0pt
+ # Margin size:
+ <format>pdf:<xsl:param>page.margin.inner=0.5in
+ # Margin size:
+ <format>pdf:<xsl:param>page.margin.outer=0.5in
+ # Paper type = A4
+ <format>pdf:<xsl:param>paper.type=A4
+ # Yes, we want graphics for admonishments:
+ <xsl:param>admon.graphics=1
+ # Set this one for PDF generation *only*:
+ # default pnd graphics are awful in PDF form,
+ # better use SVG's instead:
+ <format>pdf:<xsl:param>admon.graphics.extension=".svg"
+ <format>pdf:<xsl:param>use.role.for.mediaobject=1
+ <format>pdf:<xsl:param>preferred.mediaobject.role=print
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/
+ <format>pdf:<xsl:param>draft.mode="no"
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/math/doc/sf_and_dist/html
+ ;
+
+install pdf-install : standalone : <location>. <install-type>PDF ;

Added: sandbox/big_number/libs/math/doc/big_number.qbk
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/big_number.qbk 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,207 @@
+[/
+ Copyright 2011 John Maddock.
+ 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).
+]
+
+[library Boost.BigNumbers
+ [quickbook 1.5]
+ [copyright 2011 John Maddock]
+ [purpose Big Number library]
+ [license
+ 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])
+ ]
+ [authors [authors, various]]
+ [last-revision $Date: 2011-07-08 18:51:46 +0100 (Fri, 08 Jul 2011) $]
+]
+
+[section:intro Introduction]
+
+The Big Number library comes in two distinct parts: an expression template enabled front end `big_number`
+that handles all the operator overloading, expression evaluation optimization, and code reduction, and
+a selection of backends that implement the actual arithmetic operations, and need conform only to the
+reduced interface requirements of the front end.
+
+[endsect]
+
+[section:tut Tutorial]
+
+In order to use this library you need to make two choices: what kind of number do I want, and
+which backend do I want to perform the actual arithmetic?
+
+[section:ints Integer Types]
+
+The following backends provide integer arithmetic:
+
+[table
+[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
+[[`gmp_int`][boost/math/big_number/gmp.hpp][2][GMP][Very fast and efficient backend.][Dependency on GNU licenced GMP library.]]
+]
+
+[h4 gmp_int]
+
+ namespace boost{ namespace math{
+
+ class gmp_int;
+
+ typedef big_number<gmp_int > mpz_int;
+
+ }} // namespaces
+
+The `gmp_int` backend is used via the typedef `boost::math::mpz_int`. It acts as a thin wrapper around the GMP `mpz_t`
+to provide an integer type that is a drop-in replacement for the native C++ integer types, but with unlimited precision.
+
+[h5 Example:]
+
+ #include <boost/math/big_number/gmp.hpp>
+
+ boost::math::mpz_int v = 1;
+
+ // Do some arithmetic:
+ for(unsigned i = 1; i <= 1000; ++i)
+ v *= i;
+
+ std::cout << i << std::endl; // prints 1000!
+
+[endsect]
+
+[section:reals Real Numbers]
+
+The following backends provide real number arithmetic:
+
+[table
+[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
+[[`gmp_real<N>`][boost/math/big_number/gmp.hpp][2][GMP][Very fast and efficient backend.][Dependency on GNU licenced GMP library.]]
+]
+
+[h4 gmp_real]
+
+ namespace boost{ namespace math{
+
+ template <unsigned Digits10>
+ class gmp_real;
+
+ typedef big_number<gmp_real<50> > mpf_real_50;
+ typedef big_number<gmp_real<100> > mpf_real_100;
+ typedef big_number<gmp_real<500> > mpf_real_500;
+ typedef big_number<gmp_real<1000> > mpf_real_1000;
+ typedef big_number<gmp_real<0> > mpf_real;
+
+ }} // namespaces
+
+The `gmp_real` backend is used in conjunction with `big_number`: It acts as a thin wrapper around the GMP `mpf_t`
+to provide an real-number type that is a drop-in replacement for the native C++ floating-point types, but with
+much greater precision.
+
+Type `gmp_real` can be used at fixed precision by specifying a non-zero `Digits10` template parameter, or
+at variable precision by setting the template argument to zero. The typedefs mpf_real_50, mpf_real_100,
+mpf_real_500, mpf_real_1000 provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
+respectively. The typedef mpf_real provides a variable precision type whose precision can be controlled via the
+`big_number`'s member functions.
+
+[h5 example:]
+
+ #include <boost/math/big_number/gmp.hpp>
+
+ boost::math::gmp_real a = 2;
+ boost::math::gmp_real::default_precision(1000);
+ std::cout << boost::math::gmp_real::default_precision() << std::endl;
+ std::cout << sqrt(a) << std::endl; // print root-2
+
+[endsect]
+
+[endsect]
+
+[section:ref Reference]
+
+[section:bignum big_number]
+
+[h4 Synopsis]
+
+ namespace boost{ namespace math{
+
+ template <class Backend>
+ class big_number
+ {
+ big_number();
+ big_number(see-below);
+ big_number& operator=(see-below);
+ /* Other number-type operators here */
+ // string conversion:
+ std::string str()const;
+ // precision control:
+ static unsigned default_precision();
+ static void default_precision(unsigned digits10);
+ unsigned precision()const;
+ void precision(unsigned digits10);
+ // Comparison:
+ int compare(const big_number<Backend>& o)const;
+ template <class V>
+ typename enable_if<is_arithmetic<V>, int>::type compare(const V& o)const;
+ };
+
+ }} // namespaces
+
+[h4 Description]
+
+ big_number();
+ big_number(see-below);
+ big_number& operator=(see-below);
+
+Type `big_number` is default constructible, and copy both constructible and assignable from:
+
+* Itself.
+* An expression template which is the result of one of the arithmetic operators.
+* Any builtin arithmetic type.
+* A `std::string` or any type which is convertible to `const char*`.
+
+ /* Other number-type operators here */
+
+The following arithmetic operations are support for real-numbered types:
+
+* Binary +, -, *, /, +=, -=, *=, /=, ==, !=, <=, >=, <, >.
+* Unary +, -.
+
+For integer types the following operators are also supported:
+
+Binary %, %=.
+
+(More to follow!!)
+
+Note that the result of the binary +, -, *, / and % operations is an expression template of "unmentionable type".
+
+ std::string str()const;
+
+Returns the number formatted as a string (TODO: enable custom precision).
+
+ static unsigned default_precision();
+ static void default_precision(unsigned digits10);
+ unsigned precision()const;
+ void precision(unsigned digits10);
+
+These functions are only available if the Backend template parameter supports runtime changes to precision. They get and set
+the default precision and the precision of *this respectively.
+
+ int compare(const big_number<Backend>& o)const;
+ template <class V>
+ typename enable_if<is_arithmetic<V>, int>::type compare(const V& other)const;
+
+Returns:
+
+* A value less that 0 for *this < other
+* A value greater that 0 for *this > other
+* Zero for *this == other
+
+[endsect]
+
+[section:backendconc Backend Requirements]
+
+TODO, big boring job!!
+
+[endsect]
+
+[endsect]
+

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/intro.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/intro.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Introduction</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="prev" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="next" href="tut.html" title="Tutorial">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_bignumbers.intro"></a><a class="link" href="intro.html" title="Introduction">Introduction</a>
+</h2></div></div></div>
+<p>
+ The Big Number library comes in two distinct parts: an expression template
+ enabled front end <code class="computeroutput"><span class="identifier">big_number</span></code>
+ that handles all the operator overloading, expression evaluation optimization,
+ and code reduction, and a selection of backends that implement the actual arithmetic
+ operations, and need conform only to the reduced interface requirements of
+ the front end.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,40 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="prev" href="tut/reals.html" title="Real Numbers">
+<link rel="next" href="ref/bignum.html" title="big_number">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tut/reals.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="ref/bignum.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_bignumbers.ref"></a><a class="link" href="ref.html" title="Reference">Reference</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">big_number</span></dt>
+<dt><span class="section">Backend Requirements</span></dt>
+</dl></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tut/reals.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="ref/bignum.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/backendconc.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/backendconc.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,38 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Backend Requirements</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../ref.html" title="Reference">
+<link rel="prev" href="bignum.html" title="big_number">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bignum.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_bignumbers.ref.backendconc"></a><a class="link" href="backendconc.html" title="Backend Requirements">Backend Requirements</a>
+</h3></div></div></div>
+<p>
+ TODO, big boring job!!
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="bignum.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/bignum.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/ref/bignum.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,151 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>big_number</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../ref.html" title="Reference">
+<link rel="prev" href="../ref.html" title="Reference">
+<link rel="next" href="backendconc.html" title="Backend Requirements">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../ref.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="backendconc.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_bignumbers.ref.bignum"></a><a class="link" href="bignum.html" title="big_number">big_number</a>
+</h3></div></div></div>
+<a name="boost_bignumbers.ref.bignum.synopsis"></a><h5>
+<a name="boost_bignumbers.ref.bignum.synopsis-heading"></a>
+ <a class="link" href="bignum.html#boost_bignumbers.ref.bignum.synopsis">Synopsis</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Backend</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">big_number</span>
+<span class="special">{</span>
+ <span class="identifier">big_number</span><span class="special">();</span>
+ <span class="identifier">big_number</span><span class="special">(</span><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span><span class="special">);</span>
+ <span class="identifier">big_number</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span><span class="special">);</span>
+ <span class="comment">/* Other number-type operators here */</span>
+ <span class="comment">// string conversion:</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+ <span class="comment">// precision control:</span>
+ <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">default_precision</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">default_precision</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">digits10</span><span class="special">);</span>
+ <span class="keyword">unsigned</span> <span class="identifier">precision</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">void</span> <span class="identifier">precision</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">digits10</span><span class="special">);</span>
+ <span class="comment">// Comparison:</span>
+ <span class="keyword">int</span> <span class="identifier">compare</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">Backend</span><span class="special">&gt;&amp;</span> <span class="identifier">o</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
+ <span class="keyword">typename</span> <span class="identifier">enable_if</span><span class="special">&lt;</span><span class="identifier">is_arithmetic</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;,</span> <span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">compare</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">V</span><span class="special">&amp;</span> <span class="identifier">o</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="special">}}</span> <span class="comment">// namespaces</span>
+</pre>
+<a name="boost_bignumbers.ref.bignum.description"></a><h5>
+<a name="boost_bignumbers.ref.bignum.description-heading"></a>
+ <a class="link" href="bignum.html#boost_bignumbers.ref.bignum.description">Description</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">big_number</span><span class="special">();</span>
+<span class="identifier">big_number</span><span class="special">(</span><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span><span class="special">);</span>
+<span class="identifier">big_number</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">see</span><span class="special">-</span><span class="identifier">below</span><span class="special">);</span>
+</pre>
+<p>
+ Type <code class="computeroutput"><span class="identifier">big_number</span></code> is default
+ constructible, and copy both constructible and assignable from:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Itself.
+ </li>
+<li class="listitem">
+ An expression template which is the result of one of the arithmetic operators.
+ </li>
+<li class="listitem">
+ Any builtin arithmetic type.
+ </li>
+<li class="listitem">
+ A <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code> or any type which is convertible
+ to <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span></code>.
+ </li>
+</ul></div>
+<pre class="programlisting"><span class="comment">/* Other number-type operators here */</span>
+</pre>
+<p>
+ The following arithmetic operations are support for real-numbered types:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Binary +, -, *, /, +<code class="literal">, -</code>, *<code class="literal">, /</code>,
+ ==, !<code class="literal">, &lt;</code>, &gt;=, &lt;, &gt;.
+ </li>
+<li class="listitem">
+ Unary +, -.
+ </li>
+</ul></div>
+<p>
+ For integer types the following operators are also supported:
+ </p>
+<p>
+ Binary %, %=.
+ </p>
+<p>
+ (More to follow!!)
+ </p>
+<p>
+ Note that the result of the binary +, -, *, / and % operations is an expression
+ template of "unmentionable type".
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ Returns the number formatted as a string (TODO: enable custom precision).
+ </p>
+<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="identifier">default_precision</span><span class="special">();</span>
+<span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">default_precision</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">digits10</span><span class="special">);</span>
+<span class="keyword">unsigned</span> <span class="identifier">precision</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">precision</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">digits10</span><span class="special">);</span>
+</pre>
+<p>
+ These functions are only available if the Backend template parameter supports
+ runtime changes to precision. They get and set the default precision and
+ the precision of *this respectively.
+ </p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">compare</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">Backend</span><span class="special">&gt;&amp;</span> <span class="identifier">o</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">enable_if</span><span class="special">&lt;</span><span class="identifier">is_arithmetic</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;,</span> <span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">compare</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">V</span><span class="special">&amp;</span> <span class="identifier">other</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ Returns:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ A value less that 0 for *this &lt; other
+ </li>
+<li class="listitem">
+ A value greater that 0 for *this &gt; other
+ </li>
+<li class="listitem">
+ Zero for *this == other
+ </li>
+</ul></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../ref.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="backendconc.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,44 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Tutorial</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="prev" href="intro.html" title="Introduction">
+<link rel="next" href="tut/ints.html" title="Integer Types">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut/ints.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_bignumbers.tut"></a><a class="link" href="tut.html" title="Tutorial">Tutorial</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Integer Types</span></dt>
+<dt><span class="section">Real Numbers</span></dt>
+</dl></div>
+<p>
+ In order to use this library you need to make two choices: what kind of number
+ do I want, and which backend do I want to perform the actual arithmetic?
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut/ints.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/ints.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/ints.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,146 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Integer Types</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../tut.html" title="Tutorial">
+<link rel="prev" href="../tut.html" title="Tutorial">
+<link rel="next" href="reals.html" title="Real Numbers">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../tut.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="reals.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_bignumbers.tut.ints"></a><a class="link" href="ints.html" title="Integer Types">Integer Types</a>
+</h3></div></div></div>
+<p>
+ The following backends provide integer arithmetic:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Backend Type
+ </p>
+ </th>
+<th>
+ <p>
+ Header
+ </p>
+ </th>
+<th>
+ <p>
+ Radix
+ </p>
+ </th>
+<th>
+ <p>
+ Dependencies
+ </p>
+ </th>
+<th>
+ <p>
+ Pros
+ </p>
+ </th>
+<th>
+ <p>
+ Cons
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">gmp_int</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ boost/math/big_number/gmp.hpp
+ </p>
+ </td>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ GMP
+ </p>
+ </td>
+<td>
+ <p>
+ Very fast and efficient backend.
+ </p>
+ </td>
+<td>
+ <p>
+ Dependency on GNU licenced GMP library.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<a name="boost_bignumbers.tut.ints.gmp_int"></a><h5>
+<a name="boost_bignumbers.tut.ints.gmp_int-heading"></a>
+ <a class="link" href="ints.html#boost_bignumbers.tut.ints.gmp_int">gmp_int</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
+
+<span class="keyword">class</span> <span class="identifier">gmp_int</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_int</span> <span class="special">&gt;</span> <span class="identifier">mpz_int</span><span class="special">;</span>
+
+<span class="special">}}</span> <span class="comment">// namespaces</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">gmp_int</span></code> backend is used
+ via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">mpz_int</span></code>. It acts as a thin wrapper around
+ the GMP <code class="computeroutput"><span class="identifier">mpz_t</span></code> to provide
+ an integer type that is a drop-in replacement for the native C++ integer
+ types, but with unlimited precision.
+ </p>
+<a name="boost_bignumbers.tut.ints.example_"></a><h6>
+<a name="boost_bignumbers.tut.ints.example_-heading"></a>
+ <a class="link" href="ints.html#boost_bignumbers.tut.ints.example_">Example:</a>
+ </h6>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">big_number</span><span class="special">/</span><span class="identifier">gmp</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">mpz_int</span> <span class="identifier">v</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span>
+
+<span class="comment">// Do some arithmetic:</span>
+<span class="keyword">for</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;=</span> <span class="number">1000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="identifier">v</span> <span class="special">*=</span> <span class="identifier">i</span><span class="special">;</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// prints 1000!</span>
+</pre>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../tut.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="reals.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/reals.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/boost_bignumbers/tut/reals.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,158 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Real Numbers</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="up" href="../tut.html" title="Tutorial">
+<link rel="prev" href="ints.html" title="Integer Types">
+<link rel="next" href="../ref.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ints.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../ref.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_bignumbers.tut.reals"></a><a class="link" href="reals.html" title="Real Numbers">Real Numbers</a>
+</h3></div></div></div>
+<p>
+ The following backends provide real number arithmetic:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Backend Type
+ </p>
+ </th>
+<th>
+ <p>
+ Header
+ </p>
+ </th>
+<th>
+ <p>
+ Radix
+ </p>
+ </th>
+<th>
+ <p>
+ Dependencies
+ </p>
+ </th>
+<th>
+ <p>
+ Pros
+ </p>
+ </th>
+<th>
+ <p>
+ Cons
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ boost/math/big_number/gmp.hpp
+ </p>
+ </td>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ GMP
+ </p>
+ </td>
+<td>
+ <p>
+ Very fast and efficient backend.
+ </p>
+ </td>
+<td>
+ <p>
+ Dependency on GNU licenced GMP library.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<a name="boost_bignumbers.tut.reals.gmp_real"></a><h5>
+<a name="boost_bignumbers.tut.reals.gmp_real-heading"></a>
+ <a class="link" href="reals.html#boost_bignumbers.tut.reals.gmp_real">gmp_real</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">unsigned</span> <span class="identifier">Digits10</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">gmp_real</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="number">50</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mpf_real_50</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="number">100</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mpf_real_100</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="number">500</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mpf_real_500</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="number">1000</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mpf_real_1000</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">big_number</span><span class="special">&lt;</span><span class="identifier">gmp_real</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mpf_real</span><span class="special">;</span>
+
+<span class="special">}}</span> <span class="comment">// namespaces</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">gmp_real</span></code> backend is used
+ in conjunction with <code class="computeroutput"><span class="identifier">big_number</span></code>:
+ It acts as a thin wrapper around the GMP <code class="computeroutput"><span class="identifier">mpf_t</span></code>
+ to provide an real-number type that is a drop-in replacement for the native
+ C++ floating-point types, but with much greater precision.
+ </p>
+<p>
+ Type <code class="computeroutput"><span class="identifier">gmp_real</span></code> can be used
+ at fixed precision by specifying a non-zero <code class="computeroutput"><span class="identifier">Digits10</span></code>
+ template parameter, or at variable precision by setting the template argument
+ to zero. The typedefs mpf_real_50, mpf_real_100, mpf_real_500, mpf_real_1000
+ provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
+ respectively. The typedef mpf_real provides a variable precision type whose
+ precision can be controlled via the <code class="computeroutput"><span class="identifier">big_number</span></code>'s
+ member functions.
+ </p>
+<a name="boost_bignumbers.tut.reals.example_"></a><h6>
+<a name="boost_bignumbers.tut.reals.example_-heading"></a>
+ <a class="link" href="reals.html#boost_bignumbers.tut.reals.example_">example:</a>
+ </h6>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">big_number</span><span class="special">/</span><span class="identifier">gmp</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">gmp_real</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">gmp_real</span><span class="special">::</span><span class="identifier">default_precision</span><span class="special">(</span><span class="number">1000</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">gmp_real</span><span class="special">::</span><span class="identifier">default_precision</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">sqrt</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// print root-2</span>
+</pre>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2011 John Maddock<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ints.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../ref.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/big_number/libs/math/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/math/doc/html/index.html 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Chapter&#160;1.&#160;Boost.BigNumbers</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.BigNumbers">
+<link rel="next" href="boost_bignumbers/intro.html" title="Introduction">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_bignumbers/intro.html"><img src="images/next.png" alt="Next"></a></div>
+<div class="chapter">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="boost_bignumbers"></a>Chapter&#160;1.&#160;Boost.BigNumbers</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">various</span> <span class="surname">authors</span>
+</h3></div></div>
+<div><p class="copyright">Copyright &#169; 2011 John Maddock</p></div>
+<div><div class="legalnotice">
+<a name="id989828"></a><p>
+ 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)
+ </p>
+</div></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section">Introduction</span></dt>
+<dt><span class="section">Tutorial</span></dt>
+<dd><dl>
+<dt><span class="section">Integer Types</span></dt>
+<dt><span class="section">Real Numbers</span></dt>
+</dl></dd>
+<dt><span class="section">Reference</span></dt>
+<dd><dl>
+<dt><span class="section">big_number</span></dt>
+<dt><span class="section">Backend Requirements</span></dt>
+</dl></dd>
+</dl>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: July 08, 2011 at 18:51:46 +0100</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_bignumbers/intro.html"><img src="images/next.png" alt="Next"></a></div>
+</body>
+</html>

Modified: sandbox/big_number/libs/math/test/test_arithmetic.cpp
==============================================================================
--- sandbox/big_number/libs/math/test/test_arithmetic.cpp (original)
+++ sandbox/big_number/libs/math/test/test_arithmetic.cpp 2011-08-08 08:27:46 EDT (Mon, 08 Aug 2011)
@@ -60,6 +60,25 @@
    BOOST_TEST(a == -20 % -7);
 }
 
+template <class Real>
+void test_real_ops(const boost::mpl::false_&){}
+
+template <class Real>
+void test_real_ops(const boost::mpl::true_&)
+{
+ std::cout << "Root2 = " << sqrt(Real(2)) << std::endl;
+ BOOST_TEST(abs(Real(2)) == 2);
+ BOOST_TEST(abs(Real(-2)) == 2);
+ BOOST_TEST(fabs(Real(2)) == 2);
+ BOOST_TEST(fabs(Real(-2)) == 2);
+ BOOST_TEST(floor(Real(5) / 2) == 2);
+ BOOST_TEST(ceil(Real(5) / 2) == 3);
+ BOOST_TEST(floor(Real(-5) / 2) == -3);
+ BOOST_TEST(ceil(Real(-5) / 2) == -2);
+ BOOST_TEST(trunc(Real(5) / 2) == 2);
+ BOOST_TEST(trunc(Real(-5) / 2) == -2);
+}
+
 template <class Real, class Num>
 void test_negative_mixed(boost::mpl::true_ const&)
 {
@@ -209,6 +228,10 @@
    //
    test_integer_ops<Real>(boost::math::is_extended_integer<Real>());
    //
+ // Real number only functions:
+ //
+ test_real_ops<Real>(boost::mpl::bool_<false == boost::math::is_extended_integer<Real>::value >());
+ //
    // Test basic arithmetic:
    //
    Real a(8);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk