Given a complex number with rational components, I want to check if its square root also has rational components, and if so calculate the value. For example, given $-\frac{119}{225}+\frac{8}{15}i$ I want to get $\frac{1}{3}+\frac{4}{5}i$.
For some context, I'm writing an implementation of the Scheme programming language, which has exact and inexact numbers. A square root of an exact number should be returned as an exact number itself, if possible. And in this context, exact basically means rational, because everything else has to be expressed as floating point numbers which are inexact.
Sassatelli Giulio for pointing me to the right direction though. – Elektito Aug 31 '23 at 06:56