Skip to content

Instantly share code, notes, and snippets.

@ruan65
Created November 6, 2023 12:06
Show Gist options
  • Save ruan65/593304f0ec05edb0859ca947486a74c1 to your computer and use it in GitHub Desktop.
Save ruan65/593304f0ec05edb0859ca947486a74c1 to your computer and use it in GitHub Desktop.
Dart max min integer
int maxInteger = double.maxFinite.toInt();
const maxInteger2 = -1 >>> 1; // 1111 ... 1111 >>> 0111 ... 1111
print(maxInteger);
print(maxInteger2);
print(-maxInteger);
print(-maxInteger2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment