Square Root -1 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Square Root -1

Is there a way to calculate sqrt. -1 in any programming language?

6th Jun 2021, 7:48 PM
H Īž X V G 0 Š˜
H Īž X V G 0 Š˜ - avatar
2 Respostas
+ 4
Python natively supports complex numbers and operations. a = -1 print(a**0.5) Output: (6.123233995736766e-17+1j) Although it should be (0+1j), it looks like it's within floating point epsilon range of zero. https://code.sololearn.com/c0d8170pCSmZ/?ref=app
6th Jun 2021, 9:37 PM
Brian
Brian - avatar
0
Hi H Īž X V G 0 Š˜ I donā€™t think you can with real numbers however you could use imanginary numbers to solve the problem
6th Jun 2021, 8:25 PM
Ollie Q
Ollie Q - avatar