TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.03k stars 7.1k forks source link

fix: overflow when searching the middle of a segment #2607

Closed marishok closed 8 months ago

marishok commented 11 months ago

Fixed finding the middle of the segment. Now if "a" and "b" fit into the double type, then the middle too. In the previous implementation, there could be an exit beyond the size of double.

github-actions[bot] commented 10 months ago

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 8 months ago

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 8 months ago

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!