Implement __int__ for AD

Not sure this is really the best way to manage it, but seems to work