Giter Club home page Giter Club logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Mario,

The change was an error on my part. mpq is supposed to behave just like 
Fraction. I'll create tags/gmpy_1_13 with the fix in a day or two.

Thanks for the bug report.

Case

Original comment by casevh on 22 Jul 2010 at 6:03

  • Changed state: Started

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Thanks.

> mpq is supposed to behave just like Fraction.

Another difference between the two is
>>> a = mpq(1,3)
>>> print a.numer()
1

>>> b = Fraction(1,3)
>>> print b.numerator
1

similarly for the denominator.
Is it possible to add to gmpy.mpq something like

numerator = property(numer)

to allow the same call for both?

Mario

Original comment by [email protected] on 22 Jul 2010 at 7:44

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I've committed tags/gmpy_1_13 and it should fix the formatting. I also added 
improved caching for mpq types. I'm curious if you notice any performance 
improvements.

I'll work on adding .numerator etc. next.

Case

Original comment by casevh on 23 Jul 2010 at 6:40

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Thank you.

With version 1.13 I get 1-3% speedup.

Mario

Original comment by [email protected] on 24 Jul 2010 at 6:57

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I've added .numerator and .denominator to 1.13.

How soon do need this version officially released?

Case

Original comment by casevh on 26 Jul 2010 at 6:47

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024

> I've added .numerator and .denominator to 1.13.

Great!

Mario

Original comment by [email protected] on 26 Jul 2010 at 2:45

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
1.13 is officially released.

Original comment by casevh on 31 Aug 2010 at 5:23

  • Changed state: Fixed

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Mario,

While running some additional tests, I think my fix has a problem. Below is the 
behaviour of the Fractions module, gmpy, and gmpy2 (development branch).

>>> from fractions import Fraction
>>> str(Fraction(3,1))
'3'
>>> repr(Fraction(3,1))
'Fraction(3, 1)'
>>> from gmpy import mpq
>>> str(mpq(3,1))
'3'
>>> repr(mpq(3,1))
'mpq(3)'
>>> from gmpy2 import mpq
>>> str(mpq(3,1))
'3'
>>> repr(mpq(3,1))
'mpq(3,1)

Right now, gmpy 1.13 doesn't display the denominator of 1 even with repr. (The 
earlier bug displayed a denominator of 1 in all cases.) I'm planning a 1.14 
release within a few weeks. Will you have any problems if I use the gmpy2 
formatting rules since they match Fraction's?

casevh

Original comment by casevh on 26 Oct 2010 at 6:09

from gmpy.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Hi,

str(mpq(3,1))

 is quite fine.

Mario

Original comment by [email protected] on 26 Oct 2010 at 8:37

from gmpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.