We implement the speciality functions IMAGINARY (returns the complex number i), ZERO (returns complex 0), IDENTITY (returns the complex number 1) and EPSILON (returns our version of the tolerance we use for comparing a complex number to complex zero with the real and imaginary parts being doubles.
//====================================================//
// //
// identity //
// //
//====================================================//
MYCOMPLEX IDENTITY()
{
MYCOMPLEX z(1.0,0.0);
return(z);
}
MYCOMPLEX ZERO()
{
MYCOMPLEX z(0.0,0.0);
return(z);
}
MYCOMPLEX EPSILON()
{
MYCOMPLEX z(1.0e-14,1.03e-14);
return z;
}
MYCOMPLEX IMAGINARY()
{
MYCOMPLEX z(0.0,1.0);
return(z);
}