Skip to content

Commit 3e144ed

Browse files
committed
Add temporary test set
1 parent 754fb11 commit 3e144ed

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

test/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ run-fail benchmarks.cpp ;
4545
compile-fail concepts_test.cpp ;
4646
run github_issue_426.cpp ;
4747
run github_issue_448.cpp ;
48+
run github_issue_519.cpp ;
4849
run ibm_abs.cpp ;
4950
run ibm_add.cpp ;
5051
run link_1.cpp link_2.cpp link_3.cpp ;

test/github_issue_519.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2024 Matt Borland
2+
// Copyright 2024 Christopher Kormanyos
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// https://www.boost.org/LICENSE_1_0.txt
5+
6+
#include <boost/decimal.hpp>
7+
8+
#include <iomanip>
9+
#include <iostream>
10+
#include <limits>
11+
#include <sstream>
12+
13+
auto main() -> int
14+
{
15+
using local_decimal_type = boost::decimal::decimal128;
16+
17+
// N[Gamma[456/100], 34]
18+
// 12.64819265438397922113369900828315
19+
//
20+
// For Decimal 128:
21+
// 4.56
22+
// 12.64819265438397922113369900828314
23+
24+
const local_decimal_type x = local_decimal_type { 456, -2 };
25+
26+
const auto tg = tgamma(x);
27+
28+
{
29+
std::stringstream strm;
30+
31+
strm << std::setprecision(std::numeric_limits<local_decimal_type>::digits10) << x;
32+
33+
std::cout << strm.str() << std::endl;
34+
}
35+
36+
{
37+
std::stringstream strm;
38+
39+
strm << std::setprecision(std::numeric_limits<local_decimal_type>::digits10) << tg;
40+
41+
std::cout << strm.str() << std::endl;
42+
}
43+
44+
return 1;
45+
}

0 commit comments

Comments
 (0)