mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-02-18 02:02:17 +00:00
Fix gcc warnings and errors.
Update docs. [SVN r75284]
This commit is contained in:
28
example/mp_float_snips.cpp
Normal file
28
example/mp_float_snips.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// 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_
|
||||
|
||||
#include <boost/multiprecision/mp_float.hpp>
|
||||
#include <iostream>
|
||||
|
||||
void t1()
|
||||
{
|
||||
//[mp_float_eg
|
||||
//=#include <boost/multiprecision/mp_float.hpp>
|
||||
|
||||
using namespace boost::multiprecision;
|
||||
|
||||
// Operations at fixed precision and full numeric_limits support:
|
||||
mp_float_100 b = 2;
|
||||
std::cout << std::numeric_limits<mp_float_100>::digits << std::endl;
|
||||
std::cout << log(b) << std::endl; // print log(2)
|
||||
//]
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
t1();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user