Provided by: manpages-es-dev_4.13-4_all bug

NOMBRE

       strtoul, strtoull, strtouq - convierten una cadena en un entero largo sin signo

SINOPSIS

       #include <stdlib.h>

       unsigned long strtoul(const char *nptr, char **endptr, int base);

       unsigned long long strtoull(const char *nptr, char **endptr,
                                       int base);

   Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

       strtoull():
           _ISOC99_SOURCE ||
               || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

DESCRIPCIÓN

       The  strtoul()   function  converts  the  initial  part  of  the string in nptr to an unsigned long value
       according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.

       The string may begin with an arbitrary amount of white space (as determined by isspace(3))  followed by a
       single optional '+' or '-' sign.  If base is zero or 16, the string may then include a "0x"  prefix,  and
       the  number  will  be  read  in  base 16; otherwise, a zero base is taken as 10 (decimal) unless the next
       character is '0', in which case it is taken as 8 (octal).

       The remainder of the string is converted to an unsigned long value in the obvious manner, stopping at the
       first character which is not a valid digit in the given base.  (In bases above  10,  the  letter  'A'  in
       either uppercase or lowercase represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.)

       Si  endptr  no  es  NULL, strtoul() almacena la dirección del primer caracter no válido en *endptr. Si no
       hubiera dígitos en absoluto strtoul() almacena el valor original de nptr en *endptr.  (y devuelve 0).  En
       particular, si *nptr es distinto de '\0' pero **endptr es '\0' a la vuelta, la cadena entera es válida.

       The strtoull()  function works just like the strtoul()  function but returns an unsigned long long value.

VALOR DEVUELTO

       The strtoul()  function returns either the result of the conversion or, if  there  was  a  leading  minus
       sign,  the negation of the result of the conversion represented as an unsigned value, unless the original
       (nonnegated) value would overflow; in the latter case, strtoul()  returns ULONG_MAX  and  sets  errno  to
       ERANGE.  Precisely the same holds for strtoull()  (with ULLONG_MAX instead of ULONG_MAX).

ERRORES

       EINVAL (no está en C99)  La base dada contiene un valor no soportado.

       ERANGE El valor resultante está fuera de rango.

       La  implementación puede poner también errno a EINVAL en caso de que no se realice ninguna conversión (no
       se encuentren dígitos, y se devuelva 0).

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).
       ┌──────────────────────────────────┬────────────────────┬─────────────────────────────────────────────┐
       │ InterfazAtributoValor                                       │
       ├──────────────────────────────────┼────────────────────┼─────────────────────────────────────────────┤
       │ strtoul(), strtoull(), strtouq() │ Seguridad del hilo │ Configuración regional de multi-hilo seguro │
       └──────────────────────────────────┴────────────────────┴─────────────────────────────────────────────┘

CONFORME A

       strtoul(): POSIX.1-2001, POSIX.1-2008, C89, C99 SVr4.

       strtoull(): POSIX.1-2001, POSIX.1-2008, C99.

NOTAS

       Since strtoul()  can legitimately return 0 or ULONG_MAX (ULLONG_MAX for strtoull())  on both success  and
       failure,  the  calling  program  should  set  errno  to 0 before the call, and then determine if an error
       occurred by checking whether errno has a nonzero value after the call.

       In locales other than the "C" locale, other  strings  may  be  accepted.   (For  example,  the  thousands
       separator of the current locale may be supported.)

       BSD tiene también la función

           u_quad_t strtouq(const char *nptr, char **endptr, int base);

       con  una  definición completamente análoga.  Dependiendo del tamaño de palabra de la arquitectura actual,
       ésta puede ser equivalente a strtoull() o a strtoul().

       Negative values are considered valid input and are silently converted to  the  equivalent  unsigned  long
       value.

EJEMPLOS

       See  the example on the strtol(3)  manual page; the use of the functions described in this manual page is
       similar.

VÉASE TAMBIÉN

       a64l(3), atof(3), atoi(3), atol(3), strtod(3), strtol(3), strtoumax(3)

COLOFÓN

       Esta página es parte de la versión 5.10 del proyecto Linux man-pages. Puede encontrar una descripción del
       proyecto,  información  sobre  cómo  informar  errores  y  la  última   versión   de   esta   página   en
       https://www.kernel.org/doc/man-pages/.

TRADUCCIÓN

       La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es>

       Esta  traducción  es  documentación  libre;  lea  la GNU General Public License Version 3 o posterior con
       respecto a las condiciones de copyright.  No existe NINGUNA RESPONSABILIDAD.

       Si encuentra algún error en la traducción de esta página  del  manual,  envíe  un  correo  electrónico  a
       debian-l10n-spanish@lists.debian.org.

GNU                                             1 Noviembre 2020                                      STRTOUL(3)