mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@327677 c90b9560-bf6c-de11-be94-00142212c4b1
133 lines
3.3 KiB
XML
133 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ca01897d64baad43459268cfdb516baa6e7dfc95 Maintainer: lboshell Status: ready -->
|
|
<refentry xml:id="function.dechex" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dechex</refname>
|
|
<refpurpose>Decimal a hexadecimal</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>dechex</methodname>
|
|
<methodparam><type>int</type><parameter>number</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Devuelve una cadena que contiene una representación hexadecimal del argumento
|
|
<parameter>number</parameter> dado.
|
|
</para>
|
|
<para>
|
|
El mayor número que puede convertirse es
|
|
<constant>PHP_INT_MAX</constant><literal> * 2 + 1</literal> (o
|
|
<literal>-1</literal>): en plataformas de 32 bits, este será
|
|
<literal>4294967295</literal> en decimal, cuyos resultados utilizando
|
|
<function>dechex</function> devolverán <literal>ffffffff</literal>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>number</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Valor decimal a convertir.
|
|
</para>
|
|
<para>
|
|
Aunque los tipos <type>integer</type> PHP tienen signo, la
|
|
<function>dechex</function> los trata como enteros sin signo, de igual forma los enteros
|
|
negativos serán tratados como si no tuvieran signo.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Representación tipo cadena hexadecimal de <parameter>number</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo <function>dechex</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo dechex(10) . "\n";
|
|
echo dechex(47);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
a
|
|
2f
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>dechex</function> con números enteros grandes</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// La salida siguiente asume una plataforma de 32-bit.
|
|
// Tenga en cuenta que la salida es la misma para todos los valores.
|
|
echo dechex(-1)."\n";
|
|
echo dechex(PHP_INT_MAX * 2 + 1)."\n";
|
|
echo dechex(pow(2, 32) - 1)."\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
ffffffff
|
|
ffffffff
|
|
ffffffff
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>hexdec</function></member>
|
|
<member><function>decbin</function></member>
|
|
<member><function>decoct</function></member>
|
|
<member><function>base_convert</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
-->
|