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

Extends String to print 64-bit integers #6768

Merged
merged 1 commit into from
May 18, 2022

Conversation

SuGlider
Copy link
Collaborator

Description of Change

This PR adds support to long long (64 bits) numbers to Arduino String Class.

Tests scenarios

Tested with this sketch:

void setup()
{
  Serial.begin(115200);
  Serial.println();

  // highest signed long long 2^63 - 1 = 9223372036854775807
  // highest unsigned long long 2^64 = 18446744073709551615
  signed long long ll = -9223372036854775807;
  unsigned long long ull = 18446744073709551615;
  
  String ss(ll);
  Serial.println(ss);
  String uss(ull);
  Serial.println(uss);

  String txt("This is the highest signed long long: ");
  txt += -ll;
  Serial.println(txt);
}

Related links

Fixes #5672

@SuGlider SuGlider added this to the 2.0.4 milestone May 18, 2022
@SuGlider SuGlider requested review from me-no-dev and P-R-O-C-H-Y May 18, 2022 01:03
@SuGlider SuGlider self-assigned this May 18, 2022
@me-no-dev me-no-dev merged commit 722c464 into espressif:master May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Extend String to print 64-bit integers
2 participants