php - 10 digit decimal to binary conversion not works -
i facing issue while convert 10 digit decimal binary. when convert 9 digits works @ same time when use decbin() function 10 digit long doesn't work.
for example when convert decimal binary using decbin() function inputs 9 digits proper out. when use 10 digit decimal getting same output (1111111111111111111111111111111
) numbers between 2200000000 - 9999999999
input.
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>test</title> </head> <body> <?php $num = $_get[n]; $bin = decbin($num); // decimal binary ?> <table> <tr><td>number:</td><td><?php echo $num; ?></td></tr> <tr><td>binary:</td><td><a href='binary.php?b=<?php echo $bin; ?>'><?php echo $bin; ?></a></td></tr> </table> </body> </html>
when visit number.php?n=2200000845
shows 1111111111111111111111111111111
result.
anyone please solve problem..
on 32-bit system maximum decimal number is: 4294967295
Comments
Post a Comment