Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: floor division #69

Merged
merged 25 commits into from
Sep 20, 2015
Merged

Feature: floor division #69

merged 25 commits into from
Sep 20, 2015

Conversation

mdickinson
Copy link
Owner

This PR:

  • implements floor division, Python-style modulus, and divmod.
  • switches the implementation of % on BigFloats to use Python-style semantics for negative operands.
  • renames the old mod function to fmod.
  • adds new mod and floordiv functions for the new % semantics and the // operation, respectively.
  • removes the checks for MPFR version >= 2.4.0; we now require version 3.0 or later.

@mdickinson
Copy link
Owner Author

Error from Travis on Python 2.6 is:

======================================================================
ERROR: test_floordiv (bigfloat.test.test_bigfloat.BigFloatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/mdickinson/bigfloat/bigfloat/test/test_bigfloat.py", line 361, in test_floordiv
    z = fractions.Fraction(x) // fractions.Fraction(y)
  File "/opt/python/2.6.9/lib/python2.6/fractions.py", line 99, in __new__
    numerator = operator.index(numerator)
TypeError: 'float' object cannot be interpreted as an index

@mdickinson
Copy link
Owner Author

Changelog needs updating.

mdickinson added a commit that referenced this pull request Sep 20, 2015
@mdickinson mdickinson merged commit 2beaed4 into master Sep 20, 2015
@mdickinson mdickinson deleted the feature/floordiv branch September 20, 2015 15:28
@mdickinson mdickinson restored the feature/floordiv branch September 20, 2015 15:29
@mdickinson mdickinson deleted the feature/floordiv branch September 20, 2015 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant