Skip to content
Snippets Groups Projects
Commit 4faee1b3 authored by Andrew Heather's avatar Andrew Heather
Browse files

COMP: unitConversion - using M_PI instead of pi to avoid compiltion error due...

COMP: unitConversion - using M_PI instead of pi to avoid compiltion error due to pi not evaluating to a constexpr
parent b80f2494
Branches
Tags
No related merge requests found
......@@ -44,13 +44,15 @@ namespace Foam
//- Conversion from degrees to radians
inline constexpr scalar degToRad(const scalar deg) noexcept
{
return (deg*Foam::constant::mathematical::pi/180.0);
//return (deg*Foam::constant::mathematical::pi/180.0);
return (deg*M_PI/180.0);
}
//- Conversion from radians to degrees
inline constexpr scalar radToDeg(const scalar rad) noexcept
{
return (rad*180.0/Foam::constant::mathematical::pi);
//return (rad*180.0/Foam::constant::mathematical::pi);
return (rad*180.0/M_PI);
}
//- Conversion from atm to Pa
......@@ -69,13 +71,15 @@ inline constexpr scalar paToAtm(const scalar pa) noexcept
//- User literal for degrees to radians conversion (integers)
inline constexpr scalar operator "" _deg(unsigned long long int deg) noexcept
{
return (deg*Foam::constant::mathematical::pi/180.0);
//return (deg*Foam::constant::mathematical::pi/180.0);
return (deg*M_PI/180.0);
}
//- User literal for degrees to radians conversion (floats)
inline constexpr scalar operator "" _deg(long double deg) noexcept
{
return (deg*Foam::constant::mathematical::pi/180.0);
//return (deg*Foam::constant::mathematical::pi/180.0);
return (deg*M_PI/180.0);
}
......
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