From nobody Thu Feb 12 14:55:39 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fBddl66Sjz6Rls8 for ; Thu, 12 Feb 2026 14:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fBddl5VBmz3xSJ for ; Thu, 12 Feb 2026 14:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770908139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAsjVAYokVoFPsZ3LP9MaPQ9+j6xr6lkyiayy5ko1cw=; b=T2jF9XVdX7xNyF5mFTy4paAKoNJaXxVRz8Xq7O7/CTptwi730INtaAgj0jDvDlfNUKWGWr uWJo39T9SqiLeImtCLAQFTHwABn3s0jx0A8/eagcGxEaukx9wF+PBJNJGxqYOtiVUmi2nV z9kuBb7cdy8A1fI0MH7//W645Amo7PjQEzsAFOuLJRCk+3l/IhBG+VZ95Ukjj8iWVmjur1 G8XiE0P7OwrazBLk/O1MCNWkARNku/Y4SqZ8zBtTMpDACQ4JWapVq0YvtBwYccINiN3lqz vrAVWFelM2WULv+sPHqNCX0S8hC36fOectNereXldoWX/vJAtQWw+O5j9qFKbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770908139; a=rsa-sha256; cv=none; b=ALEEzGTJ/vtHhbKBIic8Rt3U/Y9g6UfjQbf3kPhP4Yo0yOWEIRJwvTiEHVEurrtMMkCxDx Je7cuZCm8UwDczAygR9693b949foW5yoeeIzjgrQ/R6PZc8sDT0OSkIeqghh4jZa3lCrTx bq7Uj/KSqDRIIuvNQOjAR/QzLaRhXXuCt9OWcPCnmSXx1PXUgNukIg1uRBnr8q3EM1xoxC z75ZMAAHjrBIAdQWJQ/Q+i6rRNiGcchrPv3dMT1g3XExyuzIS7zodYWHbMSpBE/kaVOZLQ J3j3hZq7TIPQ/PgX3QQ/K6ws//ibC3wOHUjRbneLgRXpNSerVkPl8+FW+t1F5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770908139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAsjVAYokVoFPsZ3LP9MaPQ9+j6xr6lkyiayy5ko1cw=; b=cNW7mmGUX9wVWq05w4My6+2vWL2YFl+mgmQIUKeCPyjf6MT+WI4rnETJK144KEJ9BbrHG4 S6dOc8xhJaIOgFjh4XblsFkohSxnSfBF368Nyw5ye0VKL7uXlPgmmAzSnGPLsppnhZfGUX Oi777OVxe0keCYpth32HLV+IaAzg/+vzMv2FhzooKRQvLwTLAV+YPCo2lCqaBQguTz9e9r 6DGtvRFQyanUMncjW/hp/h0V4/qQD6kdGo1vaK0SCwQZmEJ7y/y0G480AkzSl+jPwfap8L 2VFzwXr6JW3alXne186vSsGUXjP0OitX/zj4T+c/oRMnTWVnFkXWKXAau1GVWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fBddl4D7DzgnG for ; Thu, 12 Feb 2026 14:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 195b2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 12 Feb 2026 14:55:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 0bba277f2223 - main - libc: Improve {,l,ll,imax}div(3) manpages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bba277f2223a31e4453ade39be110b1b3aeb1dd Auto-Submitted: auto-generated Date: Thu, 12 Feb 2026 14:55:39 +0000 Message-Id: <698de9eb.195b2.5da69416@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=0bba277f2223a31e4453ade39be110b1b3aeb1dd commit 0bba277f2223a31e4453ade39be110b1b3aeb1dd Author: Aymeric Wibo AuthorDate: 2026-02-12 14:50:19 +0000 Commit: Aymeric Wibo CommitDate: 2026-02-12 14:55:14 +0000 libc: Improve {,l,ll,imax}div(3) manpages Mainly rename numerator parameter of div(3) and ldiv(3) from num to numer, and explicitly specify what "numer", "denom", and "rem" mean in the manpages. MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc (partially) Sponsored by: Klara, Inc. --- lib/libc/stdlib/div.3 | 14 ++++++++------ lib/libc/stdlib/div.c | 6 +++--- lib/libc/stdlib/imaxdiv.3 | 6 +++--- lib/libc/stdlib/ldiv.3 | 14 ++++++++------ lib/libc/stdlib/ldiv.c | 6 +++--- lib/libc/stdlib/lldiv.3 | 6 +++--- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/lib/libc/stdlib/div.3 b/lib/libc/stdlib/div.3 index 55c1bd107cb7..87b9665684fb 100644 --- a/lib/libc/stdlib/div.3 +++ b/lib/libc/stdlib/div.3 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt DIV 3 .Os .Sh NAME @@ -38,21 +38,23 @@ .Sh SYNOPSIS .In stdlib.h .Ft div_t -.Fn div "int num" "int denom" +.Fn div "int numer" "int denom" .Sh DESCRIPTION The .Fn div function computes the value -.Fa num/denom -and returns the quotient and remainder in a structure named +.Fa numer Ns / Ns Fa denom +(numerator/denominator). +It returns a structure named .Fa div_t that contains two .Vt int members named .Va quot -and -.Va rem . +(quotient) and +.Va rem +(remainder). .Sh SEE ALSO .Xr imaxdiv 3 , .Xr ldiv 3 , diff --git a/lib/libc/stdlib/div.c b/lib/libc/stdlib/div.c index 351dca870553..cdc6e1922060 100644 --- a/lib/libc/stdlib/div.c +++ b/lib/libc/stdlib/div.c @@ -35,12 +35,12 @@ #include /* div_t */ div_t -div(int num, int denom) +div(int numer, int denom) { div_t r; - r.quot = num / denom; - r.rem = num % denom; + r.quot = numer / denom; + r.rem = numer % denom; return (r); } diff --git a/lib/libc/stdlib/imaxdiv.3 b/lib/libc/stdlib/imaxdiv.3 index 1553a81edae2..9e51c47b53c3 100644 --- a/lib/libc/stdlib/imaxdiv.3 +++ b/lib/libc/stdlib/imaxdiv.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt IMAXDIV 3 .Os .Sh NAME @@ -39,9 +39,9 @@ The .Fn imaxdiv function computes the value of .Fa numer -divided by +(numerator) divided by .Fa denom -and returns the stored result in the form of the +(denominator) and returns the stored result in the form of the .Vt imaxdiv_t type. .Pp diff --git a/lib/libc/stdlib/ldiv.3 b/lib/libc/stdlib/ldiv.3 index 66abb00d4d6c..c2ab444bdcab 100644 --- a/lib/libc/stdlib/ldiv.3 +++ b/lib/libc/stdlib/ldiv.3 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 3, 2022 +.Dd February 12, 2026 .Dt LDIV 3 .Os .Sh NAME @@ -40,21 +40,23 @@ .Sh SYNOPSIS .In stdlib.h .Ft ldiv_t -.Fn ldiv "long num" "long denom" +.Fn ldiv "long numer" "long denom" .Sh DESCRIPTION The .Fn ldiv function computes the value -.Fa num Ns / Ns Fa denom -and returns the quotient and remainder in a structure named +.Fa numer Ns / Ns Fa denom +(numerator/denominator). +It returns the quotient and remainder in a structure named .Vt ldiv_t that contains two .Vt long members named .Va quot -and -.Va rem . +(quotient) and +.Va rem +(remainder). .Sh SEE ALSO .Xr div 3 , .Xr imaxdiv 3 , diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c index 7b785ef66c16..4e92c56dd3e2 100644 --- a/lib/libc/stdlib/ldiv.c +++ b/lib/libc/stdlib/ldiv.c @@ -35,12 +35,12 @@ #include /* ldiv_t */ ldiv_t -ldiv(long num, long denom) +ldiv(long numer, long denom) { ldiv_t r; - r.quot = num / denom; - r.rem = num % denom; + r.quot = numer / denom; + r.rem = numer % denom; return (r); } diff --git a/lib/libc/stdlib/lldiv.3 b/lib/libc/stdlib/lldiv.3 index d1de4e9234e3..783ea3df6554 100644 --- a/lib/libc/stdlib/lldiv.3 +++ b/lib/libc/stdlib/lldiv.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2001 +.Dd February 12, 2026 .Dt LLDIV 3 .Os .Sh NAME @@ -39,9 +39,9 @@ The .Fn lldiv function computes the value of .Fa numer -divided by +(numerator) divided by .Fa denom -and returns the stored result in the form of the +(denominator) and returns the stored result in the form of the .Vt lldiv_t type. .Pp