Bit twiddling floating point numbers

Jeff.Goldfinkle at gmail.com Jeff.Goldfinkle at gmail.com
Wed Mar 5 15:51:11 EST 2008


On Mar 5, 10:48 pm, Grant Edwards <gra... at visi.com> wrote:
> On 2008-03-05, Grant Edwards <gra... at visi.com> wrote:
>
> > On 2008-03-05, Jeff.Goldfin... at gmail.com <Jeff.Goldfin... at gmail.com> wrote:
> >> Any suggestions?
>
> > Just use the bitwise and/or/not operators: & | ~
>
> Oh, I forgot to mention the shift operators << and >>
>
> --
> Grant Edwards                   grante             Yow! All of life is a blur
>                                   at               of Republicans and meat!
>                                visi.com

thanks for the reply but I'm still unsure as to how to continue. Using
the bitwise operators will help me deal with integers but I really
want to work with floats. For instance - which bits do I twiddle to
round my float to the nearest number of bits?

Jeff



More information about the Python-list mailing list