-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_quantize.cpp
More file actions
18 lines (15 loc) · 908 Bytes
/
test_quantize.cpp
File metadata and controls
18 lines (15 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2026 Matt Borland
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/decimal.hpp>
#include <boost/core/lightweight_test.hpp>
#include "test_harness.hpp"
int main()
{
// Quantize must produce a result whose cohort matches the rhs (IEEE 754-2008 5.3.2),
// so enable strict_cohort_compare alongside the value check.
test_two_arg_harness<true, true>("dectest0/quantize0.decTest", "quantize", [](const auto x, const auto y) { return boost::decimal::quantize(x, y); });
test_two_arg_harness<true, true>("dectest/ddQuantize.decTest", "quantize", [](const auto x, const auto y) { return boost::decimal::quantize(x, y); });
test_two_arg_harness<true, true>("dectest/dqQuantize.decTest", "quantize", [](const auto x, const auto y) { return boost::decimal::quantize(x, y); });
return boost::report_errors();
}