Why doesn't it show -1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
19th Feb 2024, 3:05 PM
Sadhv Nonu
Sadhv Nonu - avatar
1 Answer
0
The square root of -1 is a complex number. That is what the output tells you. When working with float numbers, keep in mind the limits of floating point precision.
19th Feb 2024, 3:17 PM
Lisa
Lisa - avatar