HPL_setran(3)
π HPL_setran β bestie edition π
okay so this is HPL_setran(3), a lil function from the HPL Library Functions crew, and its whole job is babysitting the random number generator. yes queen, the RNG has a manager. π
β¨ NAME β¨
HPL_setran β manage the random number generator. that's it, that's the gig. π
πΈ SYNOPSIS πΈ
#include "hpl.h"
void HPL_setran( const int OPTION, int * IRAN );
π¦ DESCRIPTION π¦
so like, HPL_setran initializes the random generator with the encoding of the first number X(0) in the sequence, plus the constants a and c that get used to compute the next element in the sequence:
X(n+1) = a*X(n) + c
and where do X(0), a and c live? in the static variables irand, ias and ics. iconic little trio. π
here's the tea on OPTION, fr fr:
- when
OPTIONis0(resp.1and2),irand(resp.iaandic) is set to the values of the input arrayIRAN. - when
OPTIONis3,IRANis set to the current value ofirand, andirandis then incremented.
that's the whole vibe check. β¨
π ARGUMENTS π
OPTIONβ (local input)const intβ on entry,OPTIONis an integer that specifies the operations to be performed on the random generator as specified above. you tell it what to do, it does the thing. no cap.IRANβ (local input/output)int *β on entry,IRANis an array of dimension2, that contains the 16-lower and 15-higher bits of a random number. yes, dimension2. two slots. that's the whole container bestie. π
π SEE ALSO π
HPL_ladd (3)HPL_lmul (3)HPL_xjumpm (3)HPL_jumpit (3)HPL_rand (3)
not me writing an entire manual page about a random number generator and getting emotionally attached to it π but like, the math is mathing and the vibes are immaculate, so.
HPL 2.2 πΈ February 24, 2016 β that's the version and the date, bestie, this page has been serving since 2016 and it still eats. mwah. ππ β¨
π¦ where this page comes from
- fedora 43: hpl-doc 2.2-22.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 44: hpl-doc 2.2-23.fc44 Β· LicenseRef-Callaway-BSD-with-advertising
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms