source: trunk/test_more/dbl_epsilon.cpp @ 2794

Last change on this file since 2794 was 2506, checked in by bradbell, 7 years ago

Change Licenses: CPL-1.0 -> EPL-1.0, GPL-2.0->GPL-3.0

  • Property svn:keywords set to Id
File size: 884 bytes
Line 
1/* $Id: dbl_epsilon.cpp 2506 2012-10-24 19:36:49Z bradbell $ */
2/* --------------------------------------------------------------------------
3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-08 Bradley M. Bell
4
5CppAD is distributed under multiple licenses. This distribution is under
6the terms of the
7                    Eclipse Public License Version 1.0.
8
9A copy of this license is included in the COPYING file of this distribution.
10Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11-------------------------------------------------------------------------- */
12
13/*
14Check the value of machine epsilon is accurate enough for the correctness tests
15*/
16
17# include <cfloat>
18# include <limits>
19
20bool dbl_epsilon(void)
21{       bool ok = true;
22
23        // CppAD correctness tests assume machine epsilon is less than 1e-13
24        ok &= DBL_EPSILON < 1e-13;
25        ok &= std::numeric_limits<double>::digits10 >= 13;
26
27        return ok;
28}
Note: See TracBrowser for help on using the repository browser.