-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SampleRate: Minor fix and improvement #4091
Conversation
static SampleRate fromDouble(double value) { | ||
const auto sampleRate = SampleRate(static_cast<value_t>(value)); | ||
// The sample rate should always be an integer value | ||
// and this conversion is supposed to be lossless. |
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.
good idea. This also catches cases where value
is NaN.
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 tested. Probably yes, because there is no NaN integer.
} | ||
|
||
constexpr double toDouble() { | ||
constexpr double toDouble() const { |
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.
😨 oops
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, thank you!
Waiting for CI. |
No description provided.