tdf#147906 Use std::hypot for Pythagorean addition
Change-Id: I7813b9929771858d33e951e50e6de7893fe19085 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131684 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
committed by
Hossein
parent
323ff2749b
commit
d0055ac076
@@ -170,7 +170,7 @@ double SdwRectangle::GetRotationAngle() const
|
||||
|
||||
double SdwRectangle::CalcDistBetween2Points(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2)
|
||||
{
|
||||
return sqrt(static_cast<double>((nX1-nX2)*(nX1-nX2) + (nY1-nY2)*(nY1-nY2)));
|
||||
return std::hypot(nX1 - nX2, nY1 - nY2);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user