.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH drand48 3 "10 Febrero 2023" "Páginas de manual de Linux 6.03" .SH NOMBRE drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48 \- generan números pseudo\-aleatorios distribuidos uniformemente .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBdouble drand48(void);\fP \fBdouble erand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .PP \fBlong lrand48(void);\fP \fBlong nrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .PP \fBlong mrand48(void);\fP \fBlong jrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP .PP \fBvoid srand48(long \fP\fIseedval\fP\fB);\fP \fBunsigned short *seed48(unsigned short \fP\fIseed16v\fP\fB[3]);\fP \fBvoid lcong48(unsigned short \fP\fIparam\fP\fB[7]);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP .\" .BR drand48 (), .\" .BR erand48 (), .\" .BR lrand48 (), .\" .BR nrand48 (), .\" .BR mrand48 (), .\" .BR jrand48 (), .\" .BR srand48 (), .\" .BR seed48 (), .\" .BR lcong48 (): A continuación se muestran todas las funciones: .nf _XOPEN_SOURCE || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _SVID_SOURCE .fi .SH DESCRIPCIÓN Estas funciones generan números seudo\-aleatorios usando el algoritmo congruente lineal y artimética de enteros de 48 bits. .PP Las funciones \fBdrand48()\fP y \fBerand48()\fP devuelven valores en coma flotante de doble precisión no negativos uniformemente distribuidos entre [0.0,\ 1.0). .PP Las funciones \fBlrand48()\fP y \fBnrand48()\fP devuelven enteros largos no negativos distribuidos uniformemente en el intervalo [0,\ 2\[ha]31). .PP The \fBmrand48\fP() and \fBjrand48\fP() functions return signed long integers uniformly distributed over the interval [\-2\[ha]31,\ 2\[ha]31). .PP The \fBsrand48\fP(), \fBseed48\fP(), and \fBlcong48\fP() functions are initialization functions, one of which should be called before using \fBdrand48\fP(), \fBlrand48\fP(), or \fBmrand48\fP(). The functions \fBerand48\fP(), \fBnrand48\fP(), and \fBjrand48\fP() do not require an initialization function to be called first. .PP Todas las funciones trabajan generando una secuencia de enteros de 48 bits, \fIXi\fP, de acuerdo a la fórmula de congruencia lineal: .PP .in +4n .EX \fBXn+1 = (aXn + c) mod m, donde n >= 0\fP .EE .in .PP El parámetro \fIm\fP = 2\[ha]48, de aquí que la aritmética sea de 48 bits. A menos que se llame a \fBlcong48\fP(), \fIa\fP y \fIc\fP son: .PP .in +4n .EX \fBa = 0x5DEECE66D\fP \fBc = 0xB\fP .EE .in .PP The value returned by any of the functions \fBdrand48\fP(), \fBerand48\fP(), \fBlrand48\fP(), \fBnrand48\fP(), \fBmrand48\fP(), or \fBjrand48\fP() is computed by first generating the next 48\-bit \fIXi\fP in the sequence. Then the appropriate number of bits, according to the type of data item to be returned, is copied from the high\-order bits of \fIXi\fP and transformed into the returned value. .PP Las funciones \fBdrand48\fP(), \fBlrand48\fP() y \fBmrand48\fP() guardan el último \fIXi\fP de 48 bits generado, en un búfr interno. Las funciones \fBerand48\fP(), \fBnrand48\fP() y \fBjrand48\fP() requieren que el programa que las llame proporcione almacenamiento para los sucesivos valores \fIXi\fP en el argumento vector \fIxsubi\fP. Las funciones se inicializan al colocar el valor inicial de \fIXi\fP en la cadena antes de llamar a la función la primera vez. .PP La función inicializadora \fBsrand48\fP() asigna los 32 bits de mayor orden de \fIXi\fP al argumento \fIseedval\fP. Los 16 bits de orden bajo se rellenan con un valor arbitrario 0x330E. .PP La función inicializadora \fBseed48\fP() asigna el valor de \fIXi\fP al valor de 48 bits especificado en el argumento vector \fIseed16v\fP. Los valores anteriores de \fIXi\fP se copian en un búfer interno y \fBseed48\fP() devuelve un puntero a este búfer interno. .PP La función inicializadora \fBlcong48\fP() permite al usuario especificar los valores iniciales para \fIXi\fP, \fIa\fP y \fIc\fP. En los elementos del argumento vector \fIparam[0\-2]\fP se especifica \fIXi\fP, en \fIparam[3\-5]\fP se especifica \fIa\fP, y en \fIparam[6]\fP se especifica \fIc\fP. Después de llamar a \fBlcong48\fP(), una llamada a \fBsrand48\fP() o \fBseed48\fP() puede restaurar los valores estándares de \fIa\fP y \fIc\fP. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .ad l .nh .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ \fBdrand48\fP(), \fBerand48\fP(), \fBlrand48\fP(), \fBnrand48\fP(), \fBmrand48\fP(), \fBjrand48\fP(), \fBsrand48\fP(), \fBseed48\fP(), \fBlcong48\fP() T} Seguridad del hilo T{ MT\-Unsafe race:drand48 T} .TE .hy .ad .sp 1 .PP The above functions record global state information for the random number generator, so they are not thread\-safe. .SH ESTÁNDARES POSIX.1\-2001, POSIX.1\-2008, SVr4. .SH "VÉASE TAMBIÉN" \fBrand\fP(3), \fBrandom\fP(3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Sebastian Desimone , Gerardo Aburruzaga García y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .