MathGroup Archive 2001

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

Search the Archive

Re: how do i make a function to convert base 2 representation to base-10?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30850] Re: how do i make a function to convert base 2 representation to base-10?
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Thu, 20 Sep 2001 03:51:57 -0400 (EDT)
  • References: <9nh2a1$iu$1@smc.vnet.net> <9o990m$cs4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

josh,

FromDigits[{1,0,0,1},2]

        9

IntegerDigits[9,2]

        {1,0,0,1}

--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Au Han Bin" <auhb3 at cz3.nus.edu.sg> wrote in message
news:9o990m$cs4$1 at smc.vnet.net...
> hello, I am a mathematica newbie. i'd like some advice on creating a
> function that converts base-2 to base 10
> eg. {1,0,1} -> 9
> thanks, regards, josh
>




  • Prev by Date: fortran output in 72 columns
  • Next by Date: Re: Preserve natural number "e" using N or SetPrecision
  • Previous by thread: Re: how do i make a function to convert base 2 representation to base-10?
  • Next by thread: Exact value return