On Thu, 2007-03-08 at 15:25 -0800, Andrew Lentvorski wrote:
> Tom Gal wrote:
> > I'd say this almost one of the only times where basic C would be the best.
> > C# (like java) won't let you cast, and PERL requires all this complication,
>
> Whoa! Where did you get the idea that Perl required complication?
>
> The core of what I wrote was:
>
> > $c = pack('B64',
> > "0100000000000110010111111100101100100101111111001011001001100000");
> > ($d) = unpack('d', $c);
> > print "Converted binary string: $d", "\n";
>
> Not exactly complicated. And I'm a Pythonista.
>
> Compare this with some of the other garbage people have suggested ...
>
> The big issue was that the original data simply weren't correct. Don't
> blame Perl when you feed it bogus inputs.
>
BTW, I sent him (the engineering intern) what you sent me and it worked
for him. He also apologized for the missing zeros
Why do both the Windows and Linux calculators leave out the leading
zeros? It should give the correct number of bits for byte, word, etc.
regardless of how many leading zeros there are. That's my opinion and
I'm sticking to it! :)
PGA
--
Paul G. Allen BSIT/SE
Owner/Sr. Engineer
Random Logic Consulting
www.randomlogic.com
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg