Skip to content

Conversation

visitorckw
Copy link
Contributor

Improve the precision of semu_timer_clocksource() by deferring the division by 1e9 until the final step. Since t.numer and t.denom are typically much smaller compared to the clock frequency and 1e9, performing the division earlier in the calculation could result in a significant loss of precision. This change ensures that precision is preserved by delaying the division until the end of the computation.

Improve the precision of semu_timer_clocksource() by deferring the
division by 1e9 until the final step. Since t.numer and t.denom are
typically much smaller compared to the clock frequency and 1e9,
performing the division earlier in the calculation could result in a
significant loss of precision. This change ensures that precision is
preserved by delaying the division until the end of the computation.
@jserv jserv merged commit 92218e3 into sysprog21:master Sep 12, 2024
2 checks passed
@jserv
Copy link
Collaborator

jserv commented Sep 12, 2024

Thank @visitorckw for contributing!

@visitorckw visitorckw deleted the optimize-semu-timer-precision branch September 13, 2024 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants