I think it's neither Sage nor numpy that's at fault, it's a weird
interaction (Sage 4.6.1):

sage: import numpy
sage: numpy.binary_repr(17)
''
sage: numpy.binary_repr(int(17))
'10001'

and I think it's rooted in this fact:

sage: hex(17)
'11'
sage: hex(int(17))
'0x11'

That is, Sage capital-I Integers deliberately don't have the '0x'
prepended, and the numpy.binary_repr routine has lines

ostr = hex(num)
[..]
bin = ''.join([_lkup[ch] for ch in ostr[2:]])

which fail if the prefix isn't there.


Doug

-- 
Department of Earth Sciences
University of Hong Kong

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to