We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When doing rate conversion, fugit multiplies by RD_TIMES_LN and divides by LD_TIMES_RN in
fugit/src/rate.rs
Line 220 in 0ad21f7
Should it add half of LD_TIMES_RN to do half-up rounding?
I expect Rate<u32, 1, 1>(12_000_000) to convert to Rate<u32, 1000, 65536>(0x0020c49c) but instead I get Rate<u32, 1000, 65536>(0x0020c49b).
Rate<u32, 1, 1>(12_000_000)
Rate<u32, 1000, 65536>(0x0020c49c)
Rate<u32, 1000, 65536>(0x0020c49b)
Converting 0x0020c49b back I get 32767.990 (error 0.01) whereas 0x0020c49c gives 32768.005 (error 0.005).
0x0020c49b
0x0020c49c
Am I holding it wrong?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When doing rate conversion, fugit multiplies by RD_TIMES_LN and divides by LD_TIMES_RN in
fugit/src/rate.rs
Line 220 in 0ad21f7
Should it add half of LD_TIMES_RN to do half-up rounding?
I expect
Rate<u32, 1, 1>(12_000_000)
to convert toRate<u32, 1000, 65536>(0x0020c49c)
but instead I getRate<u32, 1000, 65536>(0x0020c49b)
.Converting
0x0020c49b
back I get 32767.990 (error 0.01) whereas0x0020c49c
gives 32768.005 (error 0.005).Am I holding it wrong?
The text was updated successfully, but these errors were encountered: