I was making a "convert Fraction to Decimal, exactly if possible" function and 
ran into a wall: it's not possible to do some of the necessary operations with 
exact precision in decimal:

- multiplication
- division where the result can be represented exactly [the divisor is an 
integer whose prime factors are only two and five, or a rational number whose 
numerator qualifies]

I assume there's some way around it that I haven't spent enough time to figure 
out [create a temporary context with sufficint digits for multiplication, and 
work out the reciprocal power of 10 by hand to use this multiplication to 
implement division], but I feel like these exact operations should be supported 
in the standard library.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/AEOK6HJJAEG65YO7T4C3KLQ4BPLX735T/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to