bitsize?

David C. Ullrich ullrich at math.okstate.edu
Fri Mar 17 13:38:25 EST 2000


Will Ware wrote:

> David C. Ullrich (ullrich at math.okstate.edu) wrote:
> >     Some comments of mine in the past have been misinterpreted
> > as requests for changes when they really were not that at all.
> > Here otoh I have a request: It would be nice if there was a
> > builtin "bitsize" function returning the number of bits in a
> > long value. (Ie ceil(log_2(n)), more or less).
>
> This may never make it into the core distribution, but it wouldn't
> be too hard to implement this in a private build.

    Thanks. One problem with that is that I don't know any C.
Well, I'm certain I could figure out enough C if I could just find
a compiler<g> - the other problem is that then I'd have to
distribute the private build with the application.

    I bet there'd be more of a demand for this if it already
existed: you don't want it unless you're doing numerical
things with longs, and you're not doing that because you
can't because there's no bitsize. (Maybe not.)

DU





More information about the Python-list mailing list