Doesn't handle complex-valued cases