qutil_double_max(3)
π qutil_double_max β the manual page, but make it cute
okay bestie, welcome to libqthread</> π
this is qutil_double_max(3), and yes the header up there also covers its two ride-or-die siblings qutil_uint_max and qutil_int_max. all three of them do the same adorable thing: they go find the biggest number in an array, and they do it in parallel. no cap. π₯
β¨ NAME β¨
qutil_double_max, qutil_uint_max, qutil_int_max β find the maximum value within an array in parallel π
πΈ SYNOPSIS πΈ
like, the whole vibe in code form:
#include <qthread.h>
#include <qthread/qutil.h>
double
qutil_double_max (double *array, size_t length, int checkfeb);
unsigned int
qutil_uint_max (unsigned int *array, size_t length, int checkfeb);
int
qutil_int_max (int *array, size_t length, int checkfeb);
π¦ DESCRIPTION π¦
so here's the tea, bestie β these functions take an array of length numbers as input and hand you back the maximum value chillin' inside those numbers. and the way they do it?? in parallel, obviously. π
they use a chained-loop structure and spin up qthreads to compute the max in chunks. it's giving divide and conquer, it's giving teamwork, it's giving main character energy. π
about that checkfeb situation: if checkfeb is non-zero, these functions will wait for the entries in the array to be full before comparing them. that's the whole point of the FEB wait. π«Ά
β οΈ but hear me out β they DO NOT check whether the array entries are properly aligned. not even a little. that's on you, bestie. π
π and if the datatype is too small to do a FEB operation on, they will abort β but only if sanity checks are turned on. so like, keep those on. please. for me.
π RETURN VALUE π
the maximum value of the first length entries of array. that's it, that's the whole gift. πβ¨
π SEE ALSO π
the whole friend group, all together, iconic behaviour:
qutil_double_mult(3)qutil_double_sum(3)qutil_double_min(3)qutil_uint_mult(3)qutil_uint_sum(3)qutil_uint_min(3)qutil_int_mult(3)qutil_int_sum(3)qutil_int_min(3)qutil_mergesort(3)qutil_qsort(3)
sign-off time π«Ά this whole thing lives under libqthread, dated APRIL 2011, and it's literally the qutil_double_max(3) page. ok bye, go find your max, bestie ππΈπ¦
π¦ where this page comes from
- fedora 43: qthreads-devel 1.22^20251007gitcedb1fc-1.fc43 Β· BSD-3-Clause AND MIT AND dtoa
- fedora 44: qthreads-devel 1.22^20251007gitcedb1fc-2.fc44 Β· BSD-3-Clause AND MIT AND dtoa
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms