Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- To: Yogeswaran Umasankar <yogu@debian.org>
- Cc: 1075905@bugs.debian.org, Daniele Nicolodi <daniele@grinta.net>, debian-devel@lists.debian.org, Andrey Rakhmatullin <wrar@debian.org>, Alexandre Detiste <alexandre.detiste@gmail.com>
- Subject: Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- From: Russ Allbery <rra@debian.org>
- Date: Sun, 07 Jul 2024 17:05:20 -0700
- Message-id: <[🔎] 874j90rbnj.fsf@hope.eyrie.org>
- In-reply-to: <[🔎] ZospCeFgS9Y8JyEG@debian> (Yogeswaran Umasankar's message of "Sun, 7 Jul 2024 19:47:21 -0400")
- References: <[🔎] ZospCeFgS9Y8JyEG@debian>
Yogeswaran Umasankar <yogu@debian.org> writes:
> As I look further, it appears that standard Python libs such as float or
> decimal.Decimal do not provide exact representation of rational numbers
> (fractions) without potential loss of precision. Seems ‘fraction’
> package yield exact results because those functions directly work on
> fractions (to my limited understanding).
> decimal.Decimal is better than float, but it only extends to arbitrary
> precision decimal arithmetic, not exact representation of rational
> numbers. Given that these libraries could potentially serve as
> dependencies for tensor-related packages and beyond, should we consider
> bringing 'fraction' or restrict ourselves to float (which is a fallback
> in moarchiving if fraction unavailable)?
I think the suggestion is to use the Python standard library package
"fractions" specifically:
https://docs.python.org/3/library/fractions.html
--
Russ Allbery (rra@debian.org) <https://www.eyrie.org/~eagle/>
Reply to:
- Prev by Date:
Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- Next by Date:
Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- Previous by thread:
Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- Next by thread:
Re: Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
- Index(es):