User:Hossein/Blog/hypot

Introduction
There are many places in the code that calculating the Pythagorean addition is needed, which is defined as:

This is hypotenuse, or the length of the longest side of a right-angled triangle, that we know the other 2 sides,  and.

https://en.wikipedia.org/wiki/Pythagorean_addition

Theoretically, this calculation could be done using, but there are problems with this approach. For large a or b, there is a possibility of overflow, although the result itself is not that big to cause overflow.

To overcome this problem, there are implementations of hypotenuse that do not use power of 2, and use other methods to calculate the result. One of them which is usable in C++ is the. To calculate a⊕b, you can easily use.

As an example, you can see this commit from Mike:

https://git.libreoffice.org/core/+/4cbaaf21fe1c22b36dd72798cecfa59e73d0f8c3

How to find instances
Among the result of this output, you can find some instances:

Final Notes
Besides fixing the bugs, there are many places to work on improving the code, and some of these are listed as EasyHacks. The specific improvement that is discussed in this blog post is filed as tdf#123.

If you want to work on this improvement, but you need to know how to get started with LibreOffice development, I suggest you to see our video tutorial:


 * YouTube: Getting Started with LibreOffice Development