Jump to content

Recommended Posts

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]
Link to comment
https://forums.phpfreaks.com/topic/15863-operater-xor/#findComment-65415
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?
Link to comment
https://forums.phpfreaks.com/topic/15863-operater-xor/#findComment-65426
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]
Link to comment
https://forums.phpfreaks.com/topic/15863-operater-xor/#findComment-65429
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]
Link to comment
https://forums.phpfreaks.com/topic/15863-operater-xor/#findComment-65430
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.