Summary: | Use hypot function for Pythagorean addition | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Hossein <hossein> |
Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | aron.budea, gang65, mentoring |
Priority: | medium | Keywords: | difficultyBeginner, easyHack, skillCpp, skillJava, skillPython, topicCleanup |
Version: | 7.4.0.0 alpha0+ | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | target:7.4.0 reviewed:2022 target:7.5.0 target:7.6.0 target:24.2.0 target:24.8.0 | ||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 143781 |
Description
Hossein
2022-03-10 14:42:34 UTC
Gautham Krishnan committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/67fcd8f268fd04ca2012470af2257b394b77b8fc tdf#147906 used std::hypot for Pythagorean addition It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. VaibhavMalik4187 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d0055ac076c61d24c505c2ffa4f99e36c97b1266 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. offtkp committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ab9896bfda4d2ef16f3cbb373edced33f9021492 tdf#147906 change all sqrt(a * a + b * b) occurences to std::hypot(a, b) It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. It seems that std::hypot is much slower that square root: https://stackoverflow.com/questions/32435796/when-to-use-stdhypotx-y-over-stdsqrtxx-yy I am wondering if this change is worth implementing (possible performance drop). Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a2d49b680cd026c3d64683f6ee3ba97e9834a7f7 tdf#147906 change sqrt(a * a + b * b) occurences to std::hypot(a, b) It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. At core/filter/source/svg/svgwriter.cxx:304 "const double fRadius = sqrt( static_cast< double >( rObjRect.GetWidth() ) * rObjRect.GetWidth() + rObjRect.GetHeight()*rObjRect.GetHeight() ) * 0.5;" Is it a candidate for changing it to: "const double fRadius = std::hypot(rObjRect.GetWidth(), rObjRect.GetHeight()) * 0.5" If yes, then why it's not letting me make a commit containing this lines of code ? If no, Some explanations will be great :)!! (In reply to Libreoffice user SSO from comment #6) > At core/filter/source/svg/svgwriter.cxx:304 "const double fRadius = sqrt( > static_cast< double >( rObjRect.GetWidth() ) * rObjRect.GetWidth() + > rObjRect.GetHeight()*rObjRect.GetHeight() ) * 0.5;" > > Is it a candidate for changing it to: > "const double fRadius = std::hypot(rObjRect.GetWidth(), > rObjRect.GetHeight()) * 0.5" > > If yes, then why it's not letting me make a commit containing this lines of > code ? The change itself is OK, if you add ; in the end. Let's discuss this in the dev IRC. pragat-pandya committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a31aadb1ef7dfdd4ae76a15707ab51a82c95d868 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Re-evaluating the EasyHack in 2022 This issue is still relevant, as there are many places in the code that a Pythagorean addition is done, and std::hypot can be used instead. Aleksa Savic committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/519dae19abddaedaf0d3d109186eeb4a08471a92 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. OmkarAcharekar committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bcf333309f9a9bde21aac1302cbead2b23822458 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1e9ace4c35e4206c24ded230433915850a1f04d1 tdf#147906 used std::hypot for Pythagorean addition It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6bf5dd8faea420aa0dbc7c429952c9868bcadb9e tdf#147906 used std::hypot for Pythagorean addition It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5b18eebc2c95321ce7e6edf10f4df81557382a48 tdf#147906 used std::hypot for Pythagorean addition It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Leonid Ryzhov committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1b44a4c558fdf597bf66c1c671248ca58e145e9e tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. ektagoel12 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/841ab19fb3f68dbab6295459ef11a257f0f022e8 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. This EasyHack was previously about C++ std::hypot, but I think it would be fine to use the similar method Math.hypot() from Java, or math.hypot() from Python. Hereby I rename the title to have a more coverage, and I also add the appropriate tag accordingly. Yomnasalama committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/08cfcea7fef6cde9eddcfa461fe1edff99dadafe tdf#147906 Use Math.hypot() for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Hi Hossein Can you please review my change, gerrit: https://gerrit.libreoffice.org/c/core/+/148547 It's been some time since it's open. adityasingh22 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1f22d01b7ae96a7efa91c9285f3d2f8c37f05237 tdf#147906: Use python's math.hypot() for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. I have understood the problem and I want to fix this issue. Multi-hacker task, don't assign Yousef_Rabia committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6700f7f5b4eae31bf020e7d073c496c6e67a2397 tdf#147906 Use Math.hypot() for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. buldi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c6755955aeaddb14bd3ad231f78cda47a0a5aeaa tdf#147906 Use std::hypot for Pythagorean addition It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. sahil committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6e12b7f296930c6f37e036407e9fb832d9a9f027 tdf#147906 used std::hypot for Pythagorean addition It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. apurvapriyadarshi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9844a197bfe91e7adb74e9e5859c7fbfaaf99e28 tdf#147906 used StrictMath.hypot for Pythagorean addition It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Ankit_Jaipuriar committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/89367021a4c960b6873370ea9472b36457c51ef3 tdf#147906 Use std::hypot for Pythagorean addition It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Started working on it. Multi-hacks are not assigned. RMZeroFour committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/45d951492a34d8d4134a518662377fa4c1e08395 tdf#147906 Use std::hypot for Pythagorean distance It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. |