[newfield_revision Patch] Use std::abs, not abs
Jeffrey Oldham
oldham at codesourcery.com
Thu Aug 16 21:26:22 UTC 2001
We want to use std::abs() which supports double arguments, not abs()'s
integral arguments.
2001-08-16 Jeffrey D. Oldham <oldham at codesourcery.com>
* Pooma/PoomaOperatorTags.h (UnaryReturn<T, FnAbs>): Change abs()
to std::abs().
* Utilities/Tester.h (Tester::check(const char *, const T&, const
T&, const T&)): Likewise.
Applied to newfield_revision branch of examples/NewField/StatigraphicFlow/
Approved by Stephen Smith
Tested on sequential Linux using gcc 3.0.1 by compiling Pooma library and NewField tests
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: Pooma/PoomaOperatorTags.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Pooma/PoomaOperatorTags.h,v
retrieving revision 1.17
diff -c -p -r1.17 PoomaOperatorTags.h
*** Pooma/PoomaOperatorTags.h 2001/03/28 19:14:51 1.17
--- Pooma/PoomaOperatorTags.h 2001/08/16 20:43:28
*************** struct FnAbs
*** 52,58 ****
inline typename UnaryReturn<T, FnAbs >::Type_t
operator()(const T &a) const
{
! return (abs(a));
}
};
--- 52,58 ----
inline typename UnaryReturn<T, FnAbs >::Type_t
operator()(const T &a) const
{
! return (std::abs(a));
}
};
Index: Utilities/Tester.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/Tester.h,v
retrieving revision 1.11
diff -c -p -r1.11 Tester.h
*** Utilities/Tester.h 2001/06/28 18:56:53 1.11
--- Utilities/Tester.h 2001/08/16 20:43:29
*************** public:
*** 213,219 ****
bool check(const char *str, const T &val, const T &correct,
const T &tol)
{
! bool res = check(abs(val - correct) < tol);
if (str != 0)
out() << "Checking " << str;
else
--- 213,219 ----
bool check(const char *str, const T &val, const T &correct,
const T &tol)
{
! bool res = check(std::abs(val - correct) < tol);
if (str != 0)
out() << "Checking " << str;
else
More information about the pooma-dev
mailing list