<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Introduction</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="book.gmp.html">GMP</a></div> <div class="next" style="text-align: right; float: right;"><a href="gmp.setup.html">Installing/Configuring</a></div> <div class="up"><a href="book.gmp.html">GMP</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intro.gmp" class="preface"> <h1 class="title">Introduction</h1> <p class="simpara"> These functions allow for arbitrary-length integers to be worked with using the GNU <acronym title="Multiple Precision">MP</acronym> library. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Most GMP functions accept GMP number arguments. These are shown in this documentation as <a href="class.gmp.html" class="classname">GMP</a> objects. However, note that PHP 5.5 and earlier represented GMP numbers as <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span>s. Most of these functions will also accept numeric and string arguments, so long as it is possible to convert the latter to a number. Also, if there is a more performant function that can operate on the arguments (integers only), then it will be used instead (this is done transparently). See also the <span class="function"><a href="function.gmp-init.html" class="function">gmp_init()</a></span> function. </p> </p></blockquote> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> From PHP 5.6 onwards, the <a href="language.operators.arithmetic.html" class="link">arithmetic</a>, <a href="language.operators.bitwise.html" class="link">bitwise</a>, and <a href="language.operators.comparison.html" class="link">comparison</a> operators may be used with the <a href="class.gmp.html" class="classname">GMP</a> objects returned from <span class="function"><a href="function.gmp-init.html" class="function">gmp_init()</a></span> and other GMP functions. </p> </p></blockquote> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara"> Large integers must be specified as strings - otherwise, PHP will coerce them to floats, resulting in a loss of precision. </p> </div> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> This extension is available on Windows platforms since PHP 5.1.0. </span> </p></blockquote> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="book.gmp.html">GMP</a></div> <div class="next" style="text-align: right; float: right;"><a href="gmp.setup.html">Installing/Configuring</a></div> <div class="up"><a href="book.gmp.html">GMP</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>