Jump to content


Photo

operater xor (^)


  • Please log in to reply
6 replies to this topic

#1 peeratep

peeratep
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 28 July 2006 - 06:46 AM

on windows->
-2694274578 ^ 1136121015 = 484406617

on linux->
-2694274578 ^ 1136121015 = -1011362633

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

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 28 July 2006 - 06:50 AM

what is it then a time stamp or what?

your are blunt sorry.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 28 July 2006 - 02:43 PM

How many bit systems are they? 32? 64?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 28 July 2006 - 08:22 PM

intersting relationship between the second integer and the linux result

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

-->[pre]
01000011101101111101010010110111  1136121015
11000011101101111101010010110111  -1011362633 linux
[/pre]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 28 July 2006 - 08:43 PM

From wiki:

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. Being 32 bits (of which one bit is the sign bit) means that it covers a range of about 68 years in total.


How does Windows handle signed integers?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 28 July 2006 - 08:49 PM

Does this clarify ?

<?php
$a = 31;
$b = -31;
echo '<pre>';
printf ('%032s %12d<br>%032s %12d<br>', 
	decbin($a), $a, decbin($b), $b);
echo '</pre>';
?>
-->[pre]
00000000000000000000000000011111          31
11111111111111111111111111100001          -31
[/pre]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#7 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 28 July 2006 - 08:57 PM

From the guys (ikegami) over at www.perlmonks.net:

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.


Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users