Skip to content
Snippets Groups Projects
Commit adcfe64b authored by Henry Weller's avatar Henry Weller
Browse files

ints: Add support for mag(int32_t) and mag(int64_t)

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1817
parent 913103ec
Branches
Tags
No related merge requests found
......@@ -136,6 +136,12 @@ public:
};
inline int32_t mag(const int32_t l)
{
return ::abs(l);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -127,6 +127,12 @@ public:
};
inline int64_t mag(const int64_t l)
{
return ::labs(l);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -36,15 +36,6 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline label mag(const label l)
{
#if WM_LABEL_SIZE == 32
return ::abs(l);
#elif WM_LABEL_SIZE == 64
return ::labs(l);
#endif
}
inline label sign(const label s)
{
return (s >= 0)? 1: -1;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment