---
name: "sroundup_lwork"
section: "3"
platform: "linux"
package: "lapack-doc"
version: "3.12.1-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sroundup_lwork.f"
---

# sroundup\_lwork(3)

Part of [sroundup\_lwork.f(3)](/sroundup_lwork.f/3.md).

## NAME

INSTALL/sroundup\_lwork.f

## SYNOPSIS

### Functions/Subroutines

real function **sroundup\_lwork** (lwork)\
 **SROUNDUP\_LWORK**

## Function/Subroutine Documentation

### real function sroundup\_lwork (integer lwork)

**SROUNDUP\_LWORK**

**Purpose:**

```
!>
!> 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.
!> E.g.,
!>
!>        float( 16777217            ) == 16777216
!>        float( 16777217 ) * (1.+eps) == 16777218
!>
!> \return SROUNDUP_LWORK
!> \verbatim
!>         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.
!>  \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp
!>
```

Definition at line **58** of file **sroundup\_lwork.f**.

## Author

Generated automatically by Doxygen for LAPACK from the source code.
