Complex rounding function taken from complexplus package to reduce the number of spant dependencies.

Imzap(x, tol = 1e-06)

Arguments

x

a scalar or vector, real or complex.

tol

a tolerance, 10^-6 by default. Prevents possible numerical problems. Can be set to 0 if desired.