Trying to understand machine epsilon in to_string.cpp test on ppc64le arch.
This commit is contained in:
parent
b7bf3ae164
commit
e586257ca0
1 changed files with 13 additions and 13 deletions
26
cppad.spec
26
cppad.spec
|
|
@ -100,16 +100,14 @@ sed -i.bak CppAD-%{version}/test_more/debug_rel/CMakeLists.txt \
|
|||
cat << EOF > temp.cpp
|
||||
# include <iostream>
|
||||
# include <limits>
|
||||
template <class Float> void print_epsilon(const char* type_name)
|
||||
{ Float epsilon = std::numeric_limits<Float>::epsilon();
|
||||
std::cout << type_name << " epsilson = " << epsilon << "\n";
|
||||
}
|
||||
int main(void)
|
||||
{ float float_eps = std::numeric_limits<float>::epsilon();
|
||||
std::cout << "float_eps = " << float_eps << "\n";
|
||||
//
|
||||
float double_eps = std::numeric_limits<double>::epsilon();
|
||||
std::cout << "double_eps = " << double_eps << "\n";
|
||||
//
|
||||
float long_double_eps = std::numeric_limits<long double>::epsilon();
|
||||
std::cout << "long_double_eps = " << long_double_eps << "\n";
|
||||
//
|
||||
{ print_epsilon<float>("float");
|
||||
print_epsilon<double>("double");
|
||||
print_epsilon<long double>("long double");
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
|
@ -160,14 +158,16 @@ cat << EOF > to_string.patch
|
|||
71a93,94
|
||||
> if( std::numeric_limits<Integer>::min() != 0 )
|
||||
> std::cout << "unsigned_integer: min != 0\n";
|
||||
83a107,110
|
||||
83a107,111
|
||||
> if( ! ok )
|
||||
> { std::cout << "check/pi - 1.0 = " << check/pi - 1.0 << "\n";
|
||||
> { std::cout << "check / pi - 1.0 = " << check / pi - 1.0;
|
||||
> std::cout << ", eps = " << eps << "\n";
|
||||
> print_error("floating", "pi", pi, check, eps);
|
||||
> }
|
||||
100a128,131
|
||||
100a129,133
|
||||
> if( ! ok )
|
||||
> { std::cout << "check/pi - 1.0 = " << check/pi - Base(1.0) << "\n";
|
||||
> { std::cout << "check / pi - 1.0 = " << check /pi - Base(1.0);
|
||||
> std::cout << ", eps = " << eps << "\n";
|
||||
> print_error("ad_floating", "pi", pi, check, eps);
|
||||
> }
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue