-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat(bench): print iter/s in the report #19994
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
|
||
#[test] | ||
fn test_into_decimal_and_fractional_parts() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a fan of tests being so inline like this because it's noisy when scrolling between functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module hasn't really been visited since it's was added, but I'll make a note of that and do a drive-by cleanup once I touch something around testing/benchmarking in the future.
let fractional_part = { | ||
let decs = ((num - num.floor()) * 10.0).round(); | ||
if decs == 10.0 { | ||
0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized I forgot to mention this. Here's a failing test case:
assert_eq!(into_decimal_and_fractional_parts(10.99), (11, 0)); // currently does 10.0
Requested by @piscisaureus