[Numpy-svn] [numpy/numpy] b03527: BUG: Fix binary_repr for negative numbers

GitHub noreply at github.com
Sun Mar 13 19:30:57 EDT 2016


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: b03527ded99dd7f6e2c6dd85ca3fdd043398d8bc
      https://github.com/numpy/numpy/commit/b03527ded99dd7f6e2c6dd85ca3fdd043398d8bc
  Author: gfyoung <gfyoung17 at gmail.com>
  Date:   2016-03-13 (Sun, 13 Mar 2016)

  Changed paths:
    M doc/release/1.12.0-notes.rst
    M numpy/core/numeric.py
    M numpy/core/tests/test_deprecations.py
    M numpy/core/tests/test_numeric.py

  Log Message:
  -----------
  BUG: Fix binary_repr for negative numbers

Completely rewrote binary_repr method to use
the Python's built-in 'bin' function to generate
binary representations quickly.

Fixed the behaviour for negative numbers in which
insufficient widths resulted in outputs of all zero's
for the two's complement. Now, it will return the
two's complement with width equal to the minimum
number of bits needed to represent the complement.

Closes gh-7168.


  Commit: c9aca387e918888e3c259ff323bbbacffd6c5d87
      https://github.com/numpy/numpy/commit/c9aca387e918888e3c259ff323bbbacffd6c5d87
  Author: Nathaniel J. Smith <njs at pobox.com>
  Date:   2016-03-13 (Sun, 13 Mar 2016)

  Changed paths:
    M doc/release/1.12.0-notes.rst
    M numpy/core/numeric.py
    M numpy/core/tests/test_deprecations.py
    M numpy/core/tests/test_numeric.py

  Log Message:
  -----------
  Merge pull request #7178 from gfyoung/binary_repr_fix

BUG: Fix binary_repr for negative numbers


Compare: https://github.com/numpy/numpy/compare/3eff0ae052c9...c9aca387e918


More information about the Numpy-svn mailing list