Answer the question
In order to leave comments, you need to log in
How to find the square root of a negative number in Pascal?
Actually, subject.
I need to find the root of a negative number, sqrt returns NaN, I'm not strong in mathematics, I have practically no idea about complex numbers, please help
Answer the question
In order to leave comments, you need to log in
The square root of a negative number is always a complex number, without variations.
In my opinion, there is no work with complex numbers in Pascal. Is it possible to add a library for working with complex numbers. But if you cleanly print the value on the screen then:
root(-N) = root(N) * i
where: "i" is an imaginary unit, it is also a root of minus one.
A complex number in mathematics is written as follows:
a + b * i
where: a is the real part, b is the imaginary part
I.e. We can say that a complex number consists of two parts, real and imaginary.
Read in your school textbook.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question