title: PHP hexdec. How to avoid unexpected round down?
body: <p>It seems that hexdec do round down automatically. I want to avoid it. How can I do it? I use PHP7.</p>
  
  <pre><code>&lt;?php
  $hex = '0x6252f8774def5e344';
  $decimal = hexdec($hex);
  echo $decimal; // 1.1335997368159E+20
  
  result:113359973681590000000
  expect:113359973681592656708
  </code></pre>
  
  <hr>
  
  <p>Update 1</p>
  
  <p>This might be similar question.
  <a href="https://stackoverflow.com/questions/1273484/large-hex-values-with-php-hexdec">Large hex values with PHP hexdec</a></p>
  
  <hr>
  
  <p>Update 2 (memo for me)</p>
  
  <p>Ivan mentioned about gmp, the following math extensions might be useful. </p>
  
  <p>Mathematical Extensions
  <a href="http://php.net/manual/en/refs.math.php" rel="nofollow noreferrer">http://php.net/manual/en/refs.math.php</a></p>