Skip to Content
Mastering Blockchain - Second Edition
book

Mastering Blockchain - Second Edition

by Ankur Daharwal, Imran Bashir, Pranav Burnwal
March 2018
Beginner to intermediate
656 pages
20h 9m
English
Packt Publishing
Content preview from Mastering Blockchain - Second Edition

Integers

This data type represents integers. The following table shows various keywords used to declare integer data types:

Keyword

Types

Details

int

Signed integer

int8 to int256, which means that keywords are available from int8 up to int256 in increments of 8, for example, int8, int16, int24.

uint

Unsigned integer

uint8, uint16, ... to uint256, unsigned integer from 8 bits to 256 bits. The usage is dependent on the requirements that how many bits are required to be stored in the variable.

For example, in this code, note that uint is an alias for uint256:

uint256 x;  
uint y;  
uint256 z; 

These types can also be declared with the constant keyword, which means that no storage slot will be reserved by the compiler ...

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 Blockchain - Third Edition

Mastering Blockchain - Third Edition

Imran Bashir
Mastering Blockchain

Mastering Blockchain

Lorne Lantz, Daniel Cawrey
Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood

Publisher Resources

ISBN: 9781788839044Supplemental Content