numpy numeric types now work with convert.
Also added support for Fraction and Decimal types.
Added a test and tested on Python 2.7 and 3.5.
Response to issue fredrik-johansson#382
We do not use subclassing in order to keep it as simple as possible. This
precludes the use of `@abstractmethod`, however it keeps the
`__init__`/`__new__` unchanged.
Not using subclassing/`@abstractmethod` means that checks whether the inferface
conforms to the requirements of the ABC are not done. Given the simplicity of
the interface in our case, this is the prefered approach. Conformity of the
interface is checked durring developpement.
Examples
========
`issubclass` works as well.
```
In [12]: import numbers
In [13]: import mpmath
In [14]: isinstance(mpmath.mpf(0.23), numbers.Complex)
Out[14]: True
In [15]: isinstance(mpmath.mpf(0.23), numbers.Real)
Out[15]: True
In [16]: isinstance(mpmath.mpf(0.23), numbers.Rational)
Out[16]: False
```
```
In [18]: isinstance(mpmath.mpc(0.23), numbers.Complex)
Out[18]: True
In [19]: isinstance(mpmath.mpc(0.23), numbers.Real)
Out[19]: False
```
```
In [20]: isinstance(mpmath.mpi(0.23), numbers.Complex)
Out[20]: True
In [21]: isinstance(mpmath.mpi(0.23), numbers.Real)
Out[21]: True
In [22]: isinstance(mpmath.mpi(0.23), numbers.Rational)
Out[22]: False
```
```
In [23]: isinstance(mpmath.mpi(0.23+1j), numbers.Complex)
Out[23]: True
In [24]: isinstance(mpmath.mpi(0.23+1j), numbers.Real)
Out[24]: False
```
* Move everything interval to a separate context (e.g. iv.exp must be used instead of mp.exp)
* Support both real and complex intervals (iv.mpf, iv.mpc)
* Fix interval cos/sin, and remove the old mpf_cos_sin code it depended on. The new interval cos/sin is a bit slower at low precision now, but this can be fixed.
* Implement interval atan2, and exp/log/power for complex intervals
* Move interval<->string code to libmpi
* Some other interface changes
More tests are still needed, and interface/utility functions needs more work.
* don't inherit from tuple
* avoid __cmp__
* fix some operations
TODO: add more tests for it; for more speed, maybe auto-convert integers to ints or use gmpy.mpq
* optimize and improve documentation for floor, ceil, isinf, isnan, isint
* implement nint, frac, isnormal
* fix and document semantics for isinf, isnan, etc
* extend documentation for mag and nint_distance
* add more tests; move tests for utility functions from test_mpmath.py to test_basic_ops.py