Gürkan Güven
PRO
last month
Gürkancountry asked

What are real and imaginary numbers, and what exactly is the difference between them?

Kelish Rai
Expert
last month
Kelish Rai answered

Real numbers are the ones you're already familiar with—like 2, -5, 3.14, 0, or even square roots like √2. These are numbers you can easily picture in everyday life, and they represent measurable quantities, like distances, temperatures, or amounts of money.

Imaginary numbers, on the other hand, are based on something a bit trickier. They're built around the concept of the square root of -1, which we represent as i. Since you can't take the square root of a negative number in the real number system, imaginary numbers fill this gap. For example, 2i or -3i are imaginary numbers.

The real magic happens when you combine real numbers with imaginary numbers. When you do that, you get a complex number, which looks like this: 3 + 2i (a real part, 3, and an imaginary part, 2i).

It’s all just another way to extend the world of numbers and solve more complex problems that you can't with just real numbers.

C
This question was asked as part of the Learn C Programming course.