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

Consider unifying _ntoa_long and _ntoa_long_long #115

Open
eyalroz opened this issue Jul 31, 2021 · 1 comment
Open

Consider unifying _ntoa_long and _ntoa_long_long #115

eyalroz opened this issue Jul 31, 2021 · 1 comment

Comments

@eyalroz
Copy link

eyalroz commented Jul 31, 2021

When ll is supported, why should we have both _ntoa_long and _ntoa_long_long? They do the exact same thing, except for the different types. Why not just put the value in a long long and use just one of the functions? It's not as though we care that much about the performance cost or stack size along the long path that saving 2 or 4 bytes matters so much... after all, we don't have _ntoa_short.

@mickjc750 : This is your idea originally.

eyalroz referenced this issue in eyalroz/printf Jul 31, 2021
eyalroz referenced this issue in eyalroz/printf Jul 31, 2021
@eyalroz
Copy link
Author

eyalroz commented Aug 1, 2021

Well, it's done on my fork, that wasn't so hard...

eyalroz referenced this issue in eyalroz/printf Aug 2, 2021
… `ntoa` function.

* Defined an `NTOA_VALUE_TYPE` based on whether `long long` is supported.
* Using an `NTOA_ABS()` macro instead of repeating the one-liner code used earlier; and it eagerly casts to avoid problems with extremal negative values.
eyalroz referenced this issue in eyalroz/printf Aug 3, 2021
… `ntoa` function.

* Defined an `NTOA_VALUE_TYPE` based on whether `long long` is supported.
* Using an `NTOA_ABS()` macro instead of repeating the one-liner code used earlier; and it eagerly casts to avoid problems with extremal negative values.
KarlK90 pushed a commit to qmk/printf that referenced this issue Jul 7, 2022
…trema of the representation range.

* Special-casing the power-of-10 function for 10^-308.
* Altered `get_normalized_components()` to not strive for better precision for near-extremal powers (at both ends) and settle for the "rougher" way to obtain the integral and decimal parts.
* Added a test-case of a near-extremal-power which fails due to the re-normalization even if the powering is correct.
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

No branches or pull requests

1 participant