Re: Computer programmers' habits in electronics



"Mike Young" <boat042-spam@xxxxxxxxx> wrote in
news:kaqqf.2184$oW.1871@xxxxxxxxxxxxxxxxxxxxxxxxxx:

> "Spehro Pefhany" <speffSNIP@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:0u2kq1h7cm70jgjmj5hari4kug5308ihtn@xxxxxxxxxx
>>> std::reverse(pStr, pStr + (len ? len : strlen(pStr)));
>>>}
>>
>> Isn't that kinda cheating?
>
> I suppose you should also ding me for <string.h>.
>
> It's a valid answer, and meaningful of itself. The follow up questions
> would bring it back to where we started.
>
> If you're not tired of the game yet, write:
>
> // return true if val is an integer power of 2; false otherwise.
> bool IsPowerOf2(unsigned val);
>
>

Can I do it in Ada? I can do C++, but I'm not too fond of it. Note that
Ada doesn't have an unsigned type, so I'm using an integer instead. The
code would be the same regardless.

/http://www.adahome.com/Ammo/cpp2ada.html

function IsPowerOf2(val: integer) return boolean is
result: integer;
begin
result := val rem 2;
if result = 0 then
return true;
else
return false;
end if;
end IsPowerOf2;

Puckdropper
--
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we
still enjoy using the old computers. Sometimes we want to see how far a
particular system can go, other times we use a stock system to remind
ourselves of what we once had.

To email me directly, send a message to puckdropper (at) fastmail.fm
.



Relevant Pages

  • Re: dropped hard disk clacks
    ... There have been people who've reported using drives ... Old computers are getting to be a lost art. ... other times we use a stock system to remind ... send a message to puckdropper fastmail.fm ...
    (sci.electronics.repair)
  • Re: Sound card I/O?
    ... had to have a method for saving data and retrieving it. ... Old computers are getting to be a lost art. ... other times we use a stock system to remind ... send a message to puckdropper fastmail.fm ...
    (comp.os.msdos.programmer)
  • Re: Ada Popularity Discussion Request
    ... From someone who's learning Ada, I'd like to suggest a few problems ... Old computers are getting to be a lost art. ... other times we use a stock system to remind ... send a message to puckdropper fastmail.fm ...
    (comp.lang.ada)
  • Re: Resurface the rough concrete?
    ... Concrete dust gets ... Old computers are getting to be a lost art. ... other times we use a stock system to remind ... send a message to puckdropper fastmail.fm ...
    (rec.woodworking)
  • Green beans
    ... They're really productive, as the package said. ... Old computers are getting to be a lost art. ... other times we use a stock system to remind ... send a message to puckdropper fastmail.fm ...
    (rec.gardens.edible)