<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.bc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'class.bcmath-number.php',
    1 => 'BcMath\\Number',
    2 => 'La clase BcMath\\Number',
  ),
  'up' => 
  array (
    0 => 'book.bc.php',
    1 => 'BC Math',
  ),
  'prev' => 
  array (
    0 => 'function.bcsub.php',
    1 => 'bcsub',
  ),
  'next' => 
  array (
    0 => 'bcmath-number.add.php',
    1 => 'BcMath\\Number::add',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/bc/bcmath.number.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.bcmath-number.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.bcmath-number" class="reference">
 <h1 class="title">La clase BcMath\Number</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 8 &gt;= 8.4.0)</p>
  <div class="section" id="bcmath-number.intro">
   <h2 class="title">Introducción</h2>
   <p class="simpara">
    Una clase para un número de precisión arbitraria.
    Estos objetos soportan los operadores
    <a href="language.operators.arithmetic.php" class="link">aritméticos</a> y
    <a href="language.operators.comparison.php" class="link">de comparación</a>.
   </p>

   <blockquote class="note"><p><strong class="note">Nota</strong>: 
    <span class="simpara">
     Esta clase no se ve afectada por la directiva INI
     <a href="bc.configuration.php#ini.bcmath.scale" class="link">bcmath.scale</a>
     definida en el <var class="filename">php.ini</var>.
    </span>
   </p></blockquote>

   <blockquote class="note"><p><strong class="note">Nota</strong>: 
    <span class="simpara">
     El comportamiento de un operador sobrecargado es el mismo que especificar <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> para el
     argumento <code class="parameter">scale</code> en el método correspondiente.
    </span>
   </p></blockquote>
  </div>

  <div class="section" id="bcmath-number.synopsis">
   <h2 class="title">Sinopsis de la Clase</h2>

   <div class="classsynopsis"><div class="classsynopsisinfo">
    <span class="modifier">namespace</span> <strong class="package">BcMath</strong>;</div>

    <div class="classsynopsisinfo">
     
      <span class="modifier">final</span>
      <span class="modifier">readonly</span>
      <span class="modifier">class</span> <strong class="classname"><strong class="classname">Number</strong></strong>
     

     
      <span class="modifier">implements</span>
       <a href="class.stringable.php" class="interfacename">Stringable</a> {</div>

     <div class="classsynopsisinfo classsynopsisinfo_comment">/* Propiedades */</div>
     <div class="fieldsynopsis">
      <span class="modifier">public</span>
      <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
       <var class="varname"><a href="class.bcmath-number.php#bcmath-number.props.value">$<var class="varname">value</var></a></var>;</div>

     <div class="fieldsynopsis"><span class="modifier">public</span>
      <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
       <var class="varname"><a href="class.bcmath-number.php#bcmath-number.props.scale">$<var class="varname">scale</var></a></var>;</div>


     <div class="classsynopsisinfo classsynopsisinfo_comment">/* Métodos */</div>
     <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>)</div>

     <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.add.php" class="methodname">add</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.ceil.php" class="methodname">ceil</a></span>(): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.compare.php" class="methodname">compare</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.div.php" class="methodname">div</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.divmod.php" class="methodname">divmod</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.floor.php" class="methodname">floor</a></span>(): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.mod.php" class="methodname">mod</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.mul.php" class="methodname">mul</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.pow.php" class="methodname">pow</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$exponent</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.powmod.php" class="methodname">powmod</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$exponent</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$modulus</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.round.php" class="methodname">round</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$precision</code><span class="initializer"> = 0</span></span>, <span class="methodparam"><span class="type"><a href="enum.roundingmode.php" class="type RoundingMode">RoundingMode</a></span> <code class="parameter">$mode</code><span class="initializer"> = <strong><code>RoundingMode::HalfAwayFromZero</code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.serialize.php" class="methodname">__serialize</a></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.sqrt.php" class="methodname">sqrt</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.sub.php" class="methodname">sub</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$num</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$scale</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="class.bcmath-number.php" class="type BcMath\Number">BcMath\Number</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.tostring.php" class="methodname">__toString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="bcmath-number.unserialize.php" class="methodname">__unserialize</a></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

    }
   </div>
  </div>

  <div class="section" id="bcmath-number.props">
   <h2 class="title">Propiedades</h2>
   <dl>
    
     <dt id="bcmath-number.props.value"><var class="varname">value</var></dt>
     <dd>
      <span class="simpara">
       Una representación en string de un número de precisión arbitraria.
      </span>
     </dd>
    
    
     <dt id="bcmath-number.props.scale"><var class="varname">scale</var></dt>
     <dd>
      <span class="simpara">
       El valor de la escala actualmente definida en el objeto.
       Para los objetos resultantes de cálculos, este valor se calcula y define automáticamente,
       a menos que el argumento <code class="parameter">scale</code> haya sido definido en el método de cálculo.
      </span>
     </dd>
    
   </dl>
  </div>

 </div>

 






































































































<h2>Tabla de contenidos</h2><ul class="chunklist chunklist_reference"><li><a href="bcmath-number.add.php">BcMath\Number::add</a> — A&ntilde;adir un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.ceil.php">BcMath\Number::ceil</a> — Redondea al alza un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.compare.php">BcMath\Number::compare</a> — Comparar dos n&uacute;meros de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.construct.php">BcMath\Number::__construct</a> — Crear un objeto BcMath\Number</li><li><a href="bcmath-number.div.php">BcMath\Number::div</a> — Divide por un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.divmod.php">BcMath\Number::divmod</a> — Devuelve el cociente y el m&oacute;dulo de un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.floor.php">BcMath\Number::floor</a> — Redondea hacia abajo un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.mod.php">BcMath\Number::mod</a> — Devuelve el m&oacute;dulo de un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.mul.php">BcMath\Number::mul</a> — Multiplica un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.pow.php">BcMath\Number::pow</a> — Eleva un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.powmod.php">BcMath\Number::powmod</a> — Eleva un n&uacute;mero de precisi&oacute;n arbitraria, reducido por un m&oacute;dulo especificado</li><li><a href="bcmath-number.round.php">BcMath\Number::round</a> — Redondea un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.serialize.php">BcMath\Number::__serialize</a> — Serializa un objeto BcMath\Number</li><li><a href="bcmath-number.sqrt.php">BcMath\Number::sqrt</a> — Devuelve la ra&iacute;z cuadrada de un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.sub.php">BcMath\Number::sub</a> — Sustrae un n&uacute;mero de precisi&oacute;n arbitraria</li><li><a href="bcmath-number.tostring.php">BcMath\Number::__toString</a> — Convierte un BcMath\Number en string</li><li><a href="bcmath-number.unserialize.php">BcMath\Number::__unserialize</a> — Deserializa un argumento de datos en un objeto BcMath\Number</li></ul>
</div>
<?php manual_footer($setup); ?>