Skip to content

Instantly share code, notes, and snippets.

@JohannesGitHub
Created September 9, 2018 12:24
Show Gist options
  • Select an option

  • Save JohannesGitHub/986aee1ecb79b27586b73da33fff9f28 to your computer and use it in GitHub Desktop.

Select an option

Save JohannesGitHub/986aee1ecb79b27586b73da33fff9f28 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.24;
contract Arithmetic {
uint256 public unsignedIntMax;
int256 public signedIntMax;
uint256 public unsignedIntMin;
int256 public signedIntMin;
constructor() public {
unsignedIntMax = ~uint256(0);
signedIntMax = int256((~uint256(0)) >> 1);
unsignedIntMin = uint256(0);
signedIntMin = int256((uint256(1) << 255));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment