]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/numeric/interval/test/overflow.cpp
1 /* Boost test/overflow.cpp
2 * test if extended precision exponent does not disturb interval computation
4 * Copyright 2002-2003 Guillaume Melquiond
6 * Distributed under the Boost Software License, Version 1.0.
7 * (See accompanying file LICENSE_1_0.txt or
8 * copy at http://www.boost.org/LICENSE_1_0.txt)
11 #include <boost/numeric/interval.hpp>
12 #include <boost/test/minimal.hpp>
16 void test_one(typename
I::base_type x
, typename
I::base_type f
) {
18 typename
I::base_type g
= 1 / f
;
20 for(int i
= 0; i
< nb
; i
++) y
*= f
;
21 for(int i
= 0; i
< nb
; i
++) y
*= g
;
22 BOOST_CHECK(in(x
, y
));
23 # ifdef BOOST_BORLANDC
24 ::detail::ignore_unused_variable_warning(nb
);
31 test_one
<I
>(1., 0.04);
32 test_one
<I
>(-1., 25.);
33 test_one
<I
>(-1., 0.04);
36 int test_main(int, char *[]) {
37 test
<boost::numeric::interval
<float> >();
38 test
<boost::numeric::interval
<double> >();
39 //test<boost::numeric::interval<long double> >();
40 # ifdef BOOST_BORLANDC
41 ::detail::ignore_warnings();