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

Bug in math/ceil #423

Closed
CatchemAL opened this issue Nov 15, 2022 · 2 comments
Closed

Bug in math/ceil #423

CatchemAL opened this issue Nov 15, 2022 · 2 comments
Labels

Comments

@CatchemAL
Copy link
Contributor

Issue
ceil function is only accurate to 1dp. For cases where n < num < n + 0.05, it will incorrectly round down.

Demonstrating the issue

    #[test]
    fn positive_decimal() {
        let num = 3.01;
        assert_eq!(ceil(num), num.ceil());
    }
CatchemAL added a commit to CatchemAL/TheAlgorithms-Rust that referenced this issue Nov 15, 2022
CatchemAL added a commit to CatchemAL/TheAlgorithms-Rust that referenced this issue Nov 15, 2022
CatchemAL added a commit to CatchemAL/TheAlgorithms-Rust that referenced this issue Nov 15, 2022
siriak pushed a commit that referenced this issue Nov 15, 2022
@github-actions
Copy link

This issue 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 github-actions bot added the stale label Dec 16, 2022
@siriak
Copy link
Member

siriak commented Dec 16, 2022

Fixed, thanks!

@siriak siriak closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants