This is implemented already or integers and floats in abstractdtype.c. Complex numbers need to be added. Note that they can store the maximum of the real and complex part making them a bit more similar to the float version.
New tests need to be added for this!
There may be more refactoring (aside from general cleanup) that should be done here as well.