Add support for complex numbers

If #9 is okay, then this patch adds support for complex numbers.