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

Fix float literals and implicit conversions #213

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

da-phil
Copy link

@da-phil da-phil commented Jun 2, 2024

Currently there is a lot of double literals all over the codebase, which need to be implicitly converted to floats in all caclucations with float variables.
This PR changes

  • Double literals to correct float literals
  • Expensive double math operations to their float version (pow -> powf, sqrt -> sqrtf)

Those changes mostly impact the heat index calculation (computeHeatIndex()) which runs around 2x faster with the proposed changes on my Arduino MKR1000 WiFi.

@da-phil da-phil force-pushed the fix_implicit_float_conversions branch from fe4bddc to dd4cacb Compare June 2, 2024 11:35
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.

1 participant