05-21-2005, 05:04 AM
05-21-2005, 05:05 AM
About time to finish it off then imo unless lith wants to make another entry.
05-21-2005, 07:14 AM
Blitz,
I tested every combinastion of the last solution that you submitted, and congratulations, it works 100%.
You know your stuff, but the code is difficult to understand. I'll have to analyse it further.
Thanks.
*****
I tested every combinastion of the last solution that you submitted, and congratulations, it works 100%.
You know your stuff, but the code is difficult to understand. I'll have to analyse it further.
Thanks.
*****
05-21-2005, 10:19 AM
you have to fucking get to know two's complement, yes i'm rude i have 17 hours of non stop coding behind me for univ. with stupid fucks that don't know their own name even.
05-21-2005, 05:12 PM
Moneo, are you stupid? No really.. you claim to know this stuff, when obviously you're not.
01110101 = 5
01110101 = 158
01110101 = 1232300
01110101 = "Hello, World!"
Binary is binary.
01110101 is always 01110101, how you interpret it a totally different matter.
As I just showed.
So stop whining, and read up on basic knowledge, and stop acting like you're the best coder in the freakin world.
01110101 = 5
01110101 = 158
01110101 = 1232300
01110101 = "Hello, World!"
Binary is binary.
01110101 is always 01110101, how you interpret it a totally different matter.
As I just showed.
So stop whining, and read up on basic knowledge, and stop acting like you're the best coder in the freakin world.
Quote:if you compared an INTEGER of -32768 to a LONG of 32768OFCOURSE AN INTEGER WILL NOT EQUAL A LONG! ARE YOU STUPID!? It's 16bits, and 32bits.. see the difference? It's quite subtle, but I'm sure you'll catch it if you stare at it long enough.
05-22-2005, 12:12 AM
Zire,
I'f your so clever, know all about binary, integer and long variables, and can comment on a challenge thread that's been going on more than a week, then submit a solution to back up your comments.
*****
I'f your so clever, know all about binary, integer and long variables, and can comment on a challenge thread that's been going on more than a week, then submit a solution to back up your comments.
*****
05-22-2005, 01:12 AM
05-22-2005, 04:14 AM
Quote:Zire,I offer thee, good sir, my most sincere appologies.
I'f your so clever, know all about binary, integer and long variables, and can comment on a challenge thread that's been going on more than a week, then submit a solution to back up your comments.
*****
I shall refrain from posting in any topic unless I offer a solution to the problem at hand.
I shall also in the upcoming future refrain from posting in any topic that was started more than two weeks ago.
Again, I deeply appologize for my irrational behaviour, and swear, as God is my witness, to become a better forum member from now on.
Thank you for showing me the true path to follow, so I may redeem and better myself.
Thank you.
:roll:
05-22-2005, 04:38 AM
Moneo -Z!re was right in what he said. And this thread is becoming ridiculous. And where's your own solution?
05-22-2005, 05:31 AM
Ok, here's my solution. Similar to Mango's solution, it is not the most elegant, is very straighforward, but it works.*****
Code:
REM NOTE: X is the input 16 bit value to be rotated 2 left.
REM X2 is the output 16 bit value as an integer.
dim x as long
dim x2 as integer
dim hexC000 as long
dim hex3FFF as long
dim top2 as long
dim bot2 as long
hexC000=&HC000& 'Bit mask to isolate 2 high-order bits
hex3FFF=&H3FFF& 'Bit mask to remove 2 high-order bits
top2 = x and hexC000 'Isolate 2 high-order bits
bot2 = top2 / 2^14 'Position 2 high-order bits into 2 low-order bits
x = x and hex3FFF 'Remove 2 high-order bits from x (just in case)
x = x * 2^2 'Shift x left 2 bits
x = x or bot2 'OR in the 2 low-order bits
REM X is the final result as long.
x2 = x 'x2 is the final 16 bit result as integer