mirror of
https://github.com/boostorg/math.git
synced 2026-02-26 16:52:27 +00:00
Fix llround for non-representable numbers
This commit is contained in:
@@ -890,6 +890,7 @@ test-suite distribution_tests :
|
||||
[ run complex_test.cpp ../../test/build//boost_unit_test_framework ]
|
||||
|
||||
[ compile test_dist_deduction_guides.cpp : [ requires cpp_deduction_guides cpp_variadic_templates ] ]
|
||||
[ run git_issue_430.cpp ../../test/build//boost_unit_test_framework ]
|
||||
[ run git_issue_800.cpp ../../test/build//boost_unit_test_framework ]
|
||||
[ run git_issue_845.cpp ../../test/build//boost_unit_test_framework ]
|
||||
[ run scipy_issue_14901.cpp ../../test/build//boost_unit_test_framework ]
|
||||
|
||||
17
test/git_issue_430.cpp
Normal file
17
test/git_issue_430.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright Matt Borland, 2023
|
||||
// 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)
|
||||
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
#include <cstdint>
|
||||
#include "math_unit_test.hpp"
|
||||
|
||||
double x = 9223372036854775807.0; // can't be represented as double, will have a different value at runtime.
|
||||
int main()
|
||||
{
|
||||
int64_t result = boost::math::llround(x);
|
||||
CHECK_EQUAL(result, INT64_C(9223372036854775807));
|
||||
|
||||
return boost::math::test::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user