Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can try;

sage: QQ(1.5)
3/2
click to hide/show revision 2
No.2 Revision

You can try;try:

sage: QQ(1.5)
3/2

or:

sage: (1.5).exact_rational()
3/2
click to hide/show revision 3
No.3 Revision

You can try:

sage: QQ(1.5)
3/2

or:

sage: (1.5).exact_rational()
3/2

As a warning, i let you undertand the following behaviour with decimal numbers:

sage: (1.1).exact_rational()
2476979795053773/2251799813685248