Jump to content

Archived

This topic is now archived and is closed to further replies.

peeratep

operater xor (^)

Recommended Posts

on windows->
-2694274578 ^ 1136121015 = 484406617

on linux->
-2694274578 ^ 1136121015 = -1011362633

i want value 484406617 on linux..help me please!
Thank you...

Share this post


Link to post
Share on other sites
what is it then a time stamp or what?

your are blunt sorry.

Share this post


Link to post
Share on other sites
How many bit systems are they? 32? 64?

Share this post


Link to post
Share on other sites
intersting relationship between the second integer and the linux result

[code]<?php
$a = 1136121015;
$b = -1011362633;
echo '<pre>';
printf ('%032s %12d<br>%032s %12d linux<br>',
decbin($a), $a, decbin($b), $b);
echo '</pre>';
?>[/code]

-->[pre]
01000011101101111101010010110111  1136121015
11000011101101111101010010110111  -1011362633 linux
[/pre]

Share this post


Link to post
Share on other sites
From wiki:

[quote]
The standard Unix time_t (data type representing a point in time) is a signed integer data type, traditionally of 32 bits (but see below), directly encoding the Unix time number as described in the preceding section. Being integer means that it has a resolution of one second; many Unix applications therefore handle time only to that resolution. [b]Being 32 bits (of which one bit is the sign bit)[/b] means that it covers a range of about 68 years in total.
[/quote]

How does Windows handle signed integers?

Share this post


Link to post
Share on other sites
Does this clarify ?

[code]
<?php
$a = 31;
$b = -31;
echo '<pre>';
printf ('%032s %12d<br>%032s %12d<br>',
decbin($a), $a, decbin($b), $b);
echo '</pre>';
?>[/code]
-->[pre]
00000000000000000000000000011111          31
11111111111111111111111111100001          -31
[/pre]

Share this post


Link to post
Share on other sites
From the guys (ikegami) over at www.perlmonks.net:

[quote]
Unix and Windows handle signs the same way: 2's complement.
The problem is that -2147483648 is the largest negative that can be stored in 32 bits.
Well, the problem is that -2694274578 is larger than -2147483648, but you are using 32 bit numbers.
[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.