MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Converting Integer to Binary and using bits

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29391] Converting Integer to Binary and using bits
  • From: Flip at safebunch.com
  • Date: Sat, 16 Jun 2001 02:48:02 -0400 (EDT)
  • Organization: http://www.newsranger.com
  • Sender: owner-wri-mathgroup at wolfram.com

Hi All,

I know that there is BaseForm[a,b] to convert between bases, but I need some
more functionality.

I need to be able to convert a large integer (300 - 600 digits) long to binary,
know the number of digits (for a looping variable) and then use each individual
bit (from high bit to low bit).

For example, n = 11, so 11 base 10 = 1011 base 2.

The length = 4.

With the for loop, a test of each bit will be done (in this example 1, 0, 1, 1).

Can someone give any direction on how to do this?  Thanks ... Flip



  • Prev by Date: Re: calculating a distribution of separation of two means
  • Next by Date: Re: formatting numbers with Export[file,exp,"Table"] possible?
  • Previous by thread: Re: Re: Odd behavior ofInterpolationFunctionderivative
  • Next by thread: Re: Converting Integer to Binary and using bits