• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  Copyright John Maddock 2007.
2 //  Copyright Paul A. Bristow 2010
3 //  Use, modification and distribution are subject to the
4 //  Boost Software License, Version 1.0. (See accompanying file
5 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 // Note that this file contains quickbook mark-up as well as code
8 // and comments, don't change any of the special comment mark-ups!
9 
10 // Setting precision in a single function call using make_policy.
11 
12 #include <iostream>
13 using std::cout; using std::endl;
14 
15 //[policy_ref_snip10
16 
17 #include <boost/math/special_functions/gamma.hpp>
18 using boost::math::tgamma;
19 
20 using namespace boost::math::policies;
21 
22 double t = tgamma(12, policy<digits10<5> >());  // Concise make_policy.
23 
24 //] //[/policy_ref_snip10]
25 
26 
27 
main()28 int main()
29 {
30    cout << "tgamma(12, policy<digits10<5> >())  = "<< t << endl;
31 }
32 
33 /*
34 
35 Output:
36 
37  tgamma(12, policy<digits10<5> >())  = 3.99168e+007
38 
39 */
40 
41