COMP: unitConversion - using M_PI instead of pi to avoid compiltion error due to pi not evaluating to a constexpr
This commit is contained in:
parent
b80f24948d
commit
4faee1b3bf
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user