1 | initial version |

First of all, there is a difference between **conversion** and **coercion**. Conversion is mostly a convenience used to initialize data from other data. The following is a conversion

```
sage: QQ(1.4)
7/5
```

Coercion is a much stronger requirement that implies that there is a natural map between the underlying set (such as ZZ -> QQ or ZZ -> Zmod(3))

```
sage: QQ.coerce(3)
3
sage: Zmod(3).coerce(3)
0
```

But there is no coercion from floating point to QQ

```
sage: QQ.coerce(1.4)
Traceback (most recent call last):
....
TypeError: no canonical coercion from Real Field with 53 bits of precision to Rational Field
```

Now to answer your question, it would be delicate to implement a conversion from floating point complex numbers to QQbar. The main reason is because of input input such as 1.41421356237310? Should it be converted to sqrt(2)? Or to 131836323/93222358 as in

```
sage: QQ(sqrt(2.))
```

131836323/93222358

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.