<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.bc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.bcscale.php',
    1 => 'bcscale',
    2 => 'Set or get default scale parameter for all bc math functions',
  ),
  'up' => 
  array (
    0 => 'ref.bc.php',
    1 => 'Функції BC Math',
  ),
  'prev' => 
  array (
    0 => 'function.bcround.php',
    1 => 'bcround',
  ),
  'next' => 
  array (
    0 => 'function.bcsqrt.php',
    1 => 'bcsqrt',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/bc/functions/bcscale.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.bcscale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bcscale</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">bcscale</span> &mdash; <span class="dc-title">Set or get default scale parameter for all bc math functions</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.bcscale-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>bcscale</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$scale</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Sets the default scale parameter for all subsequent calls to bc math functions that
   do not explicitly specify a scale parameter.
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>bcscale</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.null.php" class="type null">null</a></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>

  <p class="para rdfs-comment">
   Gets the current scale factor.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.bcscale-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">scale</code></dt>
     <dd>
      <p class="para">
       The scale factor.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.bcscale-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns the old scale when used as setter. Otherwise the current scale is returned.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.bcscale-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="simpara">
   This function throws a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> if <code class="parameter">scale</code>
   is outside the valid range.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.bcscale-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">scale</code> is now nullable.
      </td>
     </tr>

     <tr>
      <td>7.3.0</td>
      <td>
       <span class="function"><strong>bcscale()</strong></span> can now be used to get the current scale
       factor; when used as setter, it now returns the old scale value.
       Formerly, <code class="parameter">scale</code> was mandatory, and
       <span class="function"><strong>bcscale()</strong></span> always returned <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.bcscale-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>bcscale()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// default scale : 3<br /></span><span style="color: #0000BB">bcscale</span><span style="color: #007700">(</span><span style="color: #0000BB">3</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">bcdiv</span><span style="color: #007700">(</span><span style="color: #DD0000">'105'</span><span style="color: #007700">, </span><span style="color: #DD0000">'6.55957'</span><span style="color: #007700">); </span><span style="color: #FF8000">// 16.007<br /><br />// this is the same without bcscale()<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">bcdiv</span><span style="color: #007700">(</span><span style="color: #DD0000">'105'</span><span style="color: #007700">, </span><span style="color: #DD0000">'6.55957'</span><span style="color: #007700">, </span><span style="color: #0000BB">3</span><span style="color: #007700">); </span><span style="color: #FF8000">// 16.007<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

</div><?php manual_footer($setup); ?>