Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor sort_ascend Utility Function to precisely sort decimal numbers #24

Closed
mohammedelgammal opened this issue Dec 11, 2024 · 0 comments · Fixed by #25
Closed

Refactor sort_ascend Utility Function to precisely sort decimal numbers #24

mohammedelgammal opened this issue Dec 11, 2024 · 0 comments · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@mohammedelgammal
Copy link
Contributor

sort_ascend function needs to be refactored by removing int cast of return value and compare the two values and return 1 when a > b or 0 if a == b and -1 if a < b to prevent losing precision in inputs like {1.2, 1.5, 1.3, 1.8, 1.7} won't be sorted correctly as they all evaluates to zeros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants