Created
June 13, 2018 09:44
-
-
Save rolandkofler/b05bdb943b4d5b3a0d375d6103b2746e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.4.24; | |
contract TestMath { | |
uint public constant MAX_INT = uint(-1); | |
uint public constant TRILLION_18_DECIMALS = 1000000000000 * 10**18; | |
uint public constant TRILLION_SQUARED_18_DECIMALS = TRILLION_18_DECIMALS * TRILLION_18_DECIMALS; | |
uint public constant BILLION_18_DECIMALS = 1000000000 * 10**18; | |
uint public constant BILLION_CUBED_18_DECIMALS = BILLION_18_DECIMALS * BILLION_18_DECIMALS * BILLION_18_DECIMALS; | |
uint public constant 1000_18_DECIMALS = 1000 * 10**18; | |
// This line doesn't compile and a TYPE ERROR is thrown because too many decimals | |
uint public constant MUL_4_FACTORS = 1000_18_DECIMALS * 1000_18_DECIMALS * 1000_18_DECIMALS * 1000_18_DECIMALS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment