public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>,
	Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: [RFC] roundup.3: New page documenting roundup(3) (was: bug in roundup(3) from <sys/param.h>)
Date: Tue, 17 Jan 2023 21:24:27 +0100	[thread overview]
Message-ID: <d4d5892a-a2dc-832e-72ad-a9a84bdc853a@gmail.com> (raw)
In-Reply-To: <9d821d48-8ea9-7af6-10c7-0fc222437191@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1212 bytes --]

roundup(3)                 Library Functions Manual                 roundup(3)

NAME
        roundup - round up in steps

LIBRARY
        Standard C library (libc)

SYNOPSIS
        #include <sys/param.h>

        roundup(x, step);

DESCRIPTION
        This  macro  rounds  x to the nearest multiple of step that is not less
        than x.

        This macro is typically used for rounding up a pointer to align  it  or
        increasing a buffer to be allocated.

        This  API is not designed to be generic, and doesn’t work in some cases
        that are not important for the typical use cases described above.   See
        CAVEATS.

RETURN VALUE
        This macro returns the rounded value.

STANDARDS
        This nonstandard macro is present in glibc and some BSDs.

CAVEATS
        The arguments may be evaluated more than once.

        x should be nonnegative, and step should be positive.

        This  macro  produces  incorrect values when x + step would overflow or
        wrap around

SEE ALSO
        ceil(3), floor(3), lrint(3), rint(3), lround(3), round(3)

Linux man‐pages (unreleased)        (date)                          roundup(3)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-01-17 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 19:16 bug in roundup(3) from <sys/param.h> Wilco Dijkstra
2023-01-17 19:50 ` Alejandro Colomar
2023-01-17 20:11 ` Paul Eggert
2023-01-17 20:13   ` Alejandro Colomar
2023-01-17 20:24     ` Alejandro Colomar [this message]
2023-01-17 21:53       ` [RFC] roundup.3: New page documenting roundup(3) (was: bug in roundup(3) from <sys/param.h>) Paul Eggert
2023-01-17 22:29         ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4d5892a-a2dc-832e-72ad-a9a84bdc853a@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).