tdf#147906 Use std::hypot for Pythagorean addition
Change-Id: I19ecfe80e9a927c14db2680188baa54cb4911d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142535 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
parent
f4b5ecb54d
commit
bcf333309f
3 changed files with 3 additions and 3 deletions
|
@ -5096,7 +5096,7 @@ static void lcl_convertToPolar(std::vector<double>& rCmplxArray, double fMinMag)
|
|||
{
|
||||
fR = rCmplxArray[nIdx];
|
||||
fI = rCmplxArray[nPoints+nIdx];
|
||||
fMag = sqrt(fR*fR + fI*fI);
|
||||
fMag = std::hypot(fR, fI);
|
||||
if (fMag < fMinMag)
|
||||
{
|
||||
fMag = 0.0;
|
||||
|
|
|
@ -652,7 +652,7 @@ inline double Complex::Imag() const
|
|||
|
||||
inline double Complex::Abs() const
|
||||
{
|
||||
return sqrt( r * r + i * i );
|
||||
return std::hypot(r, i);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ void Camera3D::SetBankAngle(double fAngle)
|
|||
|
||||
// Rotate on Z axis, to rotate the BankAngle and back
|
||||
basegfx::B3DHomMatrix aTf;
|
||||
const double fV(sqrt(aDiff.getY() * aDiff.getY() + aDiff.getZ() * aDiff.getZ()));
|
||||
const double fV(std::hypot(aDiff.getY(), aDiff.getZ()));
|
||||
|
||||
if (fV != 0.0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue