Skip to content

Use strtof rather than atof for float values#2726

Open
toofishes wants to merge 1 commit into
meshcore-dev:devfrom
toofishes:config-float-values
Open

Use strtof rather than atof for float values#2726
toofishes wants to merge 1 commit into
meshcore-dev:devfrom
toofishes:config-float-values

Conversation

@toofishes

@toofishes toofishes commented Jun 8, 2026

Copy link
Copy Markdown

atof produces a double value, which we immediately cast to a float in several cases. Like we already do elsewhere, e.g. in tempradio, use strtof to avoid using the double type at all. While unlikely, this should also avoid any double rounding precision isssues, as well as be a bit faster.

This is similar to #1104.

`atof` produces a double value, which we immediately cast to a float in several
cases. Like we already do elsewhere, e.g. in `tempradio`, use `strtof` to avoid
using the double type at all. While unlikely, this should also avoid any double
rounding precision isssues, as well as be a bit faster.
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