-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Increase buffer size for converting floats + doubles to String's #5369
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with "10" there? I can understand how -, . and 0円 are added to the number of digits that FLT_MAX_10_EXP represents, but not what 10 means.
@darrylp1per
darrylp1per
Nov 24, 2016
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 as in ascii 10, being a LineFeed perhaps ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On AVR DBL_MAX_10_EXP
is 38
and Serial.println(String(-DBL_MAX));
prints out -340282350000000000000000000000000000000.00
.
Which is 43
characters in length, then you need an extra byte for the 0円
, which brings us to 44
.
44 - 38 - 2 = 4
. Maybe, I was thinking the extra character was for the 1's
digit ...
Partially moved to arduino/ArduinoCore-sam#32
❌ Build failed.
CLAassistant
commented
Apr 9, 2021
CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Port of arduino/ArduinoCore-samd#163
Troublesome sketch: