Numeric literal syntax
Compare digit separators, scientific notation, and hexadecimal literals.
Solidity 0.8.36REPL mode
Why use this example
Use this pattern to confirm Solidity arithmetic and unit behavior before putting the same expression into a contract. The entry isolates numeric literal syntax so its input, result, and state changes stay easy to compare.
Solidity to run
uint256 grouped = 1_000_000
uint256 scientific = 2e6
uint256 hexadecimal = 0x2a
grouped
scientific
hexadecimalOfficial Solidity reference
Compare this focused investigation with the complete language definition in the Solidity documentation.
Rational and integer literalsWhat to expect
The three literal forms evaluate to 1,000,000, 2,000,000, and 42 without losing their uint256 type.
Continue the investigation
Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.
Read about writing Solidity Prototype Solidity behavior