[ create a new paste ] login | about

Link: http://codepad.org/AXICCZeS    [ raw code | output | fork ]

slevy1ster - PHP, pasted on Feb 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
printf("\n%d\n",0xfffffffd);
echo "with echo: ",0xfffffffd,"\n";
$a = 65;
printf("%b\n",$a);
$i = ~$a + 1;   // get twos complement
echo "\$i: ",$i,"\n";                 
printf("TC: 0x%x\n\n",$i);
printf("Decimal: %d\n\n",0xffffffbf);
echo "\nwith echo: ",0xffffffbf;            
$c = base_convert($i,10,2);
echo $c,"\n";
$v = intval($c,2);
echo $v;


Output:
1
2
3
4
5
6
7
8
9
10
11
12

-3
with echo: 4294967293
1000001
$i: -65
TC: 0xffffffbf

Decimal: -65


with echo: 42949672311000001
65


Create a new paste based on this one


Comments: