1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 07:22:16 +01:00
Files
archived-doc-es/reference/bc/book.xml
Philippe DELENTE 9a3cc94a9d clean up not EN tree + move/rename file PDO (#166)
* clean up not EN tree + move/rename file PDO

* Review and translation

---------

Co-authored-by: Marcos Porto Mariño <php@marcospor.to>
2025-03-18 01:25:23 +01:00

77 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: c7e83fbbbcde9f54affc09424d032c38492a3ff4 Maintainer: Marqitos Status: ready -->
<!-- Reviewed: no -->
<book xml:id="book.bc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<?phpdoc extension-membership="bundled" ?>
<title>Matemáticas de precisión arbitraria BCMath</title>
<titleabbrev>BC Math</titleabbrev>
<!-- {{{ preface -->
<preface xml:id="intro.bc">
&reftitle.intro;
<para>
Para matemáticas de precisión arbitraria, PHP ofrece BCMath,
que admite números de cualquier tamaño y precisión de hasta <literal>2147483647</literal> (o <literal>0x7FFFFFFF</literal>) dígitos decimales,
si hay suficiente memoria, representados como cadenas.
</para>
<para>
Números válidos (también conocidos como bien formados) en BCMath son cadenas que coinciden con la expresión regular
<literal>/^[+-]?[0-9]*(\.[0-9]*)?$/</literal>.
</para>
<caution>
<para>
Pasar valores de tipo <type>float</type> a una función de BCMath que espera
un <type>string</type> como operando puede no tener el efecto deseado debido a
la forma en que PHP convierte valores de tipo <type>float</type> a <type>string</type>, es decir,
que el <type>string</type> puede estar en notación exponencial (que no es
compatible con BCMath), y que, antes de PHP 8.0.0, el separador decimal dependía
de la configuración regional (mientras que BCMath siempre espera un punto decimal).
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
$num1 = 0; // (string) 0 => '0'
$num2 = -0.000005; // (string) -0.000005 => '-5.05E-6'
echo bcadd($num1, $num2, 6); // => '0.000000'
setlocale(LC_NUMERIC, 'de_DE'); // Utiliza una coma decimal
$num2 = 1.2; // (string) 1.2 => '1,2'
echo bcsub($num1, $num2, 1); // => '0.0'
?>
]]>
</programlisting>
</informalexample>
</caution>
</preface>
<!-- }}} -->
&reference.bc.setup;
&reference.bc.reference;
&reference.bc.bcmath.number;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->