/ informatics / theory /

[edit]

Definition

This is a converter for showing numbers in different number systems.

Type in number:
C/Ada Notation: 0x.. / 16#.. (hex), 0b.. / 2#.. (bin)

Result
Decimal 255
Hexadecimal 0xFF
Octal 0377
Binary 0b11111111

Memory Inspection

Number stored as unsigned 32bit Integer at address 0x1000:

Endian 0x1000 0x1001 0x1002 0x1003
Little (bin) 11111111 00000000 00000000 00000000
Little (hex) FF 00 00 00
Big (bin) 00000000 00000000 00000000 11111111
Big (hex) 00 00 00 FF

Data Types

int, short, and word depend on the architecture.

Type Limit Min Limit Max
U8, Char 0 .. 255=281255 = 2^8 - 1
U16 0 .. 65535=216165535 = 2^{16} -1
U32 0 .. 42949672954\,294\,967\,295
U64 0 .. 1844674407370955161518\;446\;744\;073\;709\;551\;615
Uxx 0 .. 2x12^x - 1
I8 -128 .. 127
I16 −32768 .. 32767
I32 -2 147 483 648 .. 2.147.483.647
Ixx 2(x1)-2^{(x-1)} .. 2(x1)12^{(x-1)} - 1

Useful approximations: 2101k2^{10} \approx 1k 2201M2^{20} \approx 1M 2301G2^{30} \approx 1G

2-Complement