Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work

源代码在线查看: overflow.cpp

软件大小: 35482 K
上传用户: sinba
关键词: libraries peer-reviewed emphasize provides
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* Boost test/overflow.cpp				 * test if extended precision exponent does not disturb interval computation				 *				 * Copyright 2002-2003 Guillaume Melquiond				 *				 * Distributed under 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 				#include 				#include "bugs.hpp"								template				void test_one(typename I::base_type x, typename I::base_type f) {				  I y = x;				  typename I::base_type g = 1 / f;				  const int nb = 10000;				  for(int i = 0; i < nb; i++) y *= f;				  for(int i = 0; i < nb; i++) y *= g;				  BOOST_CHECK(in(x, y));				# ifdef __BORLANDC__				  ::detail::ignore_unused_variable_warning(nb);				# endif				}								template				void test() {				  test_one(1., 25.);				  test_one(1., 0.04);				  test_one(-1., 25.);				  test_one(-1., 0.04);				}								int test_main(int, char *[]) {				  test();				  test();				  //test();				# ifdef __BORLANDC__				  ::detail::ignore_warnings();				# endif				  return 0;				}							

相关资源