[Numpy-svn] [numpy/numpy] e5f4f8: BUG: gh-2935, fix printing of scalar float -0.0.

GitHub noreply@github....
Sun Jan 20 19:04:34 CST 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: e5f4f8283e7721b0a72b621b765c42d7d7866f4f
      https://github.com/numpy/numpy/commit/e5f4f8283e7721b0a72b621b765c42d7d7866f4f
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-01-20 (Sun, 20 Jan 2013)

  Changed paths:
    M numpy/core/src/multiarray/scalartypes.c.src

  Log Message:
  -----------
  BUG: gh-2935, fix printing of scalar float -0.0.

The issue was that the string value of scalar floating types equal to -0.0
lacked a trailing ".0".

    >>> print np.float64(-0.0)
    -0

The problem resulted from using val < 0 to check for a leading negative
sign. That expression evaluates false when val = -0.0, and the need to
append ".0" was not detected.


  Commit: d55b5aa49d2ba1c98d568660b1a91b4b552872f0
      https://github.com/numpy/numpy/commit/d55b5aa49d2ba1c98d568660b1a91b4b552872f0
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-01-20 (Sun, 20 Jan 2013)

  Changed paths:
    A numpy/core/tests/test_scalarprint.py

  Log Message:
  -----------
  TST: Add test for printing of scalar values.


  Commit: e548eedba12831bd5d68cb9c52a86e9330aa8ae0
      https://github.com/numpy/numpy/commit/e548eedba12831bd5d68cb9c52a86e9330aa8ae0
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-01-20 (Sun, 20 Jan 2013)

  Changed paths:
    M numpy/core/src/multiarray/scalartypes.c.src
    A numpy/core/tests/test_scalarprint.py

  Log Message:
  -----------
  Merge pull request #2936 from charris/fix-print-negative-float-zero

Fix print negative float zero


Compare: https://github.com/numpy/numpy/compare/56b06fe5bf20...e548eedba128


More information about the Numpy-svn mailing list