Hi there! I am Mohammad Abbasi 👋

I am a computer enthusiast, and here i will write about computer, software, tech, and my personal experiences. I am currently working as a software engineer at ArvanCloud.
From Bits to Integers

From Bits to Integers: The Journey of Numbers in Computers

Understanding how computers handle integers is foundational to computer science and software development. In this post, we’ll explore how integers are stored, represented, and manipulated in binary systems. What Are Integer Data Types? Integers are whole numbers (no fractions) that can be positive, negative, or zero. In programming, they’re categorized into two types: Unsigned Integers: Non-negative values (0, 1, 2, …) Signed Integers: Positive, negative, and zero These values are stored as binary sequences (0s and 1s), where longer bit sequences allow larger numbers to be represented. ...

January 28, 2025 · 6 min
Generics in Go

Generics in Go

You probably know that Go is a statically typed language, which means that every variable in your program must have a predefined type. For example, when we define a function, we need to specify the types of its parameters, like in the following code: func Print(s string) { fmt.Println(s) } Here, we have defined a parameter named “s” with the string type. We can define any number of additional parameters with any types, such as float64, int, or structs. However, the problem arises when we want to pass a number(or other types) to this function because numbers are of type int, and we can’t assign an int to a variable of type string. Previously, we used to define the type of the “s” parameter as an interface, which partially solved this problem but still had many limitations. ...

August 27, 2024 · 3 min