Skip to Content
Mastering Blockchain Programming with Solidity
book

Mastering Blockchain Programming with Solidity

by Jitendra Chittoda
August 2019
Intermediate to advanced
486 pages
13h 52m
English
Packt Publishing
Content preview from Mastering Blockchain Programming with Solidity

Integer value type

Solidity supports signed integer (int) and unsigned integer (uint) data types of various sizes. Based on the size of your data, you can choose from 8- to 256-bit (in steps of 8) data types. For example, for int, you can have int8, int16, int24, and so on, in increments of 8 up to int256. In the same way, you can have uint from uint8, to uint16, uint24, and so on, in increments of 8 up to uint256.

If you use only int/uint in your code, these are aliases of int256/uint256. An int/uint data type is declared and assigned, as shown here:

int varInt = -25; //Signed integer, int is alias of int256uint varUint = 25; //Unsigned integer, uint is alias of uint256

Regardless of the intN or uintN type you are using, its default value ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood
Complete Cryptocurrency and Blockchain Course | Learn Solidity

Complete Cryptocurrency and Blockchain Course | Learn Solidity

Ravinder Deol, Codestars By Rob Percival, Thomas Wiesner

Publisher Resources

ISBN: 9781839218262Supplemental Content