[Numpy-discussion] inconsistent behavior in binary_repr
Wed Jun 4 02:59:35 CDT 2008
On Wed, Jun 4, 2008 at 2:56 AM, Damian Eads <email@example.com> wrote:
> I noticed some odd behavior in binary_repr when the width parameter is
> used. In most cases it works,
> In : numpy.binary_repr(1, width=8)
> Out: '00000001'
> In : numpy.binary_repr(2, width=8)
> Out: '00000010'
> In : numpy.binary_repr(3, width=8)
> Out: '00000011'
> In : numpy.binary_repr(4, width=8)
> Out: '00000100'
> except when 0 is passed, I get the following
> In : numpy.binary_repr(0, width=8)
> Out: '0'
> Is this what the output is intended to be for the 0 case?
No. SVN trunk seems to work correctly. What version of numpy do you have?
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion