package
0.0.0-20200526015148-b343531734ec
Repository: https://github.com/fakorede/learning-golang.git
Documentation: pkg.go.dev

# README

Overflow

Explanation

This program dives deep into how Go behaves when a value goes beyond the range of its declared type i.e. an Overflow

But Go cannot catch Overflow errors in runtime

Instead, the values wraps around to the minimum negative or maximum positive depending on the type.

Cheat Sheet

SIGEND TYPES
Minimum value - 1Max Positive
Maximum value + 1Min Negative
Example for int8(-128 to 127)
-128 - 1127
127 + 1-128
UNSIGNED TYPES
Minimum value - 1Max Positive
Maximum value + 1Zero
Example for uint8(0 to 255)
0 - 1255
255 + 10