roundup_lwork(3)
π NAME π
okay so this is roundup_lwork(3) from the Library Functions Manual β yes bestie, the Library Functions Manual, and we're about to get into the whole integer-to-float rounding situation. π
roundup_lworkβroundup_lwork: fix rounding integer to float. That's the whole assignment, no cap. β¨
β¨ SYNOPSIS β¨
π«Ά Functions
double precision function droundup_lwork (lwork)β this is theDROUNDUP_LWORKone. πreal function sroundup_lwork (lwork)β and this is theSROUNDUP_LWORKone. π¦
π Detailed Description π
The original page leaves this section pretty lowkey β it's just the Detailed Description stop before we hit Function Documentation. Mysterious main character energy, honestly. π
π Function Documentation π
π double precision function droundup_lwork (integer lwork) π
DROUNDUP_LWORK is the name of the game here. π
β¨ Purpose β¨
okay so DROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float. The way it handles it: this routine guarantees it is rounded up instead of down by multiplying LWORK by 1+eps when it is necessary, where eps is the relative machine precision. That's the tea. π«
Example time, bestie:
float( 9007199254740993 ) == 9007199254740992
float( 9007199254740993 ) * (1.+eps) == 9007199254740994
Returns: DROUNDUP_LWORK π
DROUNDUP_LWORK >= LWORK.DROUNDUP_LWORK is guaranteed to have zero decimal part.
π«Ά Parameters
LWORKβ Workspace size. π
πΈ Author
Weslley Pereira, University of Colorado Denver, USA. π
π¦ Further Details
This routine was inspired in the method magma_zmake_lwork from MAGMA. The source even points you at \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp. π₯
π Definition
Definition at line 58 of file droundup_lwork.f. β¨
π real function sroundup_lwork (integer lwork) π
SROUNDUP_LWORK is the other icon of this page. π
β¨ Purpose β¨
okay so SROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float. This routine guarantees it is rounded up instead of down by multiplying LWORK by 1+eps when it is necessary, where eps is the relative machine precision. Same energy, different precision. β
Example:
float( 16777217 ) == 16777216
float( 16777217 ) * (1.+eps) == 16777218
Returns: SROUNDUP_LWORK π«Ά
SROUNDUP_LWORK >= LWORK.SROUNDUP_LWORK is guaranteed to have zero decimal part.
π«Ά Parameters
LWORKβ Workspace size. πΈ
πΈ Author
Weslley Pereira, University of Colorado Denver, USA. π
π¦ Further Details
This routine was inspired in the method magma_zmake_lwork from MAGMA. The source even points you at \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp. π₯
π Definition
Definition at line 58 of file sroundup_lwork.f. β¨
π Author π
Generated automatically by Doxygen for LAPACK from the source code. π€π
Cute sign-off: this is LAPACK, Version 3.12.0, and the page is roundup_lwork(3) β the date slot is literally blank in the original, so no invented dates, bestie. Byeee! π
β¨
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms