Re: Binary to Decimal

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Hendrik Schober (SpamTrap_at_gmx.de)
Date: 03/03/05


Date: Thu, 3 Mar 2005 02:47:35 +0100

lmh86 <lmh86@discussions.microsoft.com> wrote:
> [...]
> Can anyone suggest any other methods that does not implement built-in
> functions?

  This sounds like some homework, so I will
  hint you into some direction, but won't
  post code.
  When you have this:
    int i;
    std::cin >> i;
  the value ist stored in 'i' in binary form.
  (That's the only way the computer knows.)
  If you look at the lowest bit of 'i' (by
  masking off the others) you know it's value.
  After that, you can shift 'i's content to
  the right one position and thus inspect the
  next bit at the same position.
  Feel free to ask if anything in this is not
  clear.

> Please and thankyou.

  Schobi

-- 
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
 to be prefered to those thinking they've found it."
 Terry Pratchett


Relevant Pages

  • Re: Ping Conway the Gardener.
    ... U.S. were opposed to it and since Obama will soon be coming ... Hint: Try doing your own homework to support your own claims. ... Your parents have a lot to answer for. ...
    (soc.culture.scottish)
  • Re: Ping Conway the Gardener.
    ... Obama didn't want to commit himself. ... Final Environmental Impact Statement for the Proposed Keystone XL ... Hint: Try doing your own homework to support your own claims. ...
    (soc.culture.scottish)
  • Re: numbers to text
    ... You change by writing program in Prolog ... This is your homework and you should figure it out ... twenty, thirty, ...ninety the teens ... Another hint: the div and mod operators can be useful for such a function. ...
    (comp.lang.prolog)
  • Re: Which prices are fake?
    ... Of course Benford's law doesn't help here, but as a hint, it suggests ... since the trailing digits for such tend ... Martin Penderis wrote: ... > challenge to all, and if the wording sounds like homework, I would not ...
    (sci.stat.math)
  • Re: NNz wont take a 160-by-120 binary image??
    ... do NOT name a variable INPUT as this is a built-in ML function... ... I have followed you instructions but i got a different set of errors this time. ...
    (comp.soft-sys.matlab)