public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] man/: Replaced reserved exp identifier
@ 2025-07-02  9:25 Vincent Lefevre
  2025-07-02 14:41 ` Alejandro Colomar
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2025-07-02  9:25 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Since exp is a library function, this is a reserved identifier, which
should not be used as a variable name / parameter.

For some of the replacements:

Like in ISO C23 (new in this revision), for the frexp* and ldexp*
functions, exp is replaced by p, and for the scalb[l]n* functions,
exp is replaced by n (thus ditto for the deprecated scalb* functions).

Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
---
 man/man2/timerfd_create.2 | 16 ++++++++--------
 man/man3/frexp.3          | 20 ++++++++++----------
 man/man3/ldexp.3          | 12 ++++++------
 man/man3/scalb.3          | 26 +++++++++++++-------------
 man/man3/scalbln.3        | 18 +++++++++---------
 5 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/man/man2/timerfd_create.2 b/man/man2/timerfd_create.2
index bcab72f37..a58b3ddfb 100644
--- a/man/man2/timerfd_create.2
+++ b/man/man2/timerfd_create.2
@@ -639,12 +639,12 @@ main(int argc, char *argv[])
 {
     int                fd;
     ssize_t            s;
-    uint64_t           exp, tot_exp, max_exp;
+    uint64_t           ex, tot_ex, max_ex;
     struct timespec    now;
     struct itimerspec  new_value;
 \&
     if (argc != 2 && argc != 4) {
-        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
+        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",
                 argv[0]);
         exit(EXIT_FAILURE);
     }
@@ -659,10 +659,10 @@ main(int argc, char *argv[])
     new_value.it_value.tv_nsec = now.tv_nsec;
     if (argc == 2) {
         new_value.it_interval.tv_sec = 0;
-        max_exp = 1;
+        max_ex = 1;
     } else {
         new_value.it_interval.tv_sec = atoi(argv[2]);
-        max_exp = atoi(argv[3]);
+        max_ex = atoi(argv[3]);
     }
     new_value.it_interval.tv_nsec = 0;
 \&
@@ -676,14 +676,14 @@ main(int argc, char *argv[])
     print_elapsed_time();
     printf("timer started\[rs]n");
 \&
-    for (tot_exp = 0; tot_exp < max_exp;) {
-        s = read(fd, &exp, sizeof(uint64_t));
+    for (tot_ex = 0; tot_ex < max_ex;) {
+        s = read(fd, &ex, sizeof(uint64_t));
         if (s != sizeof(uint64_t))
             err(EXIT_FAILURE, "read");
 \&
-        tot_exp += exp;
+        tot_ex += ex;
         print_elapsed_time();
-        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", exp, tot_exp);
+        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", ex, tot_ex);
     }
 \&
     exit(EXIT_SUCCESS);
diff --git a/man/man3/frexp.3 b/man/man3/frexp.3
index a741137c2..2812798c3 100644
--- a/man/man3/frexp.3
+++ b/man/man3/frexp.3
@@ -14,9 +14,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double frexp(double " x ", int *" exp );
-.BI "float frexpf(float " x ", int *" exp );
-.BI "long double frexpl(long double " x ", int *" exp );
+.BI "double frexp(double " x ", int *" p );
+.BI "float frexpf(float " x ", int *" p );
+.BI "long double frexpl(long double " x ", int *" p );
 .fi
 .P
 .RS -4
@@ -36,7 +36,7 @@ These functions are used to split the number
 .I x
 into a
 normalized fraction and an exponent which is stored in
-.IR exp .
+.IR p .
 .SH RETURN VALUE
 These functions return the normalized fraction.
 If the argument
@@ -52,20 +52,20 @@ If
 .I x
 is zero, then the normalized fraction is
 zero and zero is stored in
-.IR exp .
+.IR p .
 .P
 If
 .I x
 is a NaN,
 a NaN is returned, and the value of
-.I *exp
+.I *p
 is unspecified.
 .P
 If
 .I x
 is positive infinity (negative infinity),
 positive infinity (negative infinity) is returned, and the value of
-.I *exp
+.I *p
 is unspecified.
 .SH ERRORS
 No errors occur.
@@ -118,12 +118,12 @@ int
 main(int argc, char *argv[])
 {
     double x, r;
-    int exp;
+    int p;
 \&
     x = strtod(argv[1], NULL);
-    r = frexp(x, &exp);
+    r = frexp(x, &p);
 \&
-    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, exp, x);
+    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, p, x);
     exit(EXIT_SUCCESS);
 }
 .EE
diff --git a/man/man3/ldexp.3 b/man/man3/ldexp.3
index c2f5289f3..daa1290f5 100644
--- a/man/man3/ldexp.3
+++ b/man/man3/ldexp.3
@@ -13,9 +13,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double ldexp(double " x ", int " exp );
-.BI "float ldexpf(float " x ", int " exp );
-.BI "long double ldexpl(long double " x ", int " exp );
+.BI "double ldexp(double " x ", int " p );
+.BI "float ldexpf(float " x ", int " p );
+.BI "long double ldexpl(long double " x ", int " p );
 .fi
 .P
 .RS -4
@@ -34,13 +34,13 @@ Feature Test Macro Requirements for glibc (see
 These functions return the result of multiplying the floating-point number
 .I x
 by 2 raised to the power
-.IR exp .
+.IR p .
 .SH RETURN VALUE
 On success, these functions return
-.IR "x * (2\[ha]exp)" .
+.IR "x * (2\[ha]p)" .
 .P
 If
-.I exp
+.I p
 is zero, then
 .I x
 is returned.
diff --git a/man/man3/scalb.3 b/man/man3/scalb.3
index 6968931ba..bfa3a1f59 100644
--- a/man/man3/scalb.3
+++ b/man/man3/scalb.3
@@ -15,9 +15,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "[[deprecated]] double scalb(double " x ", double " exp );
-.BI "[[deprecated]] float scalbf(float " x ", float " exp );
-.BI "[[deprecated]] long double scalbl(long double " x ", long double " exp );
+.BI "[[deprecated]] double scalb(double " x ", double " n );
+.BI "[[deprecated]] float scalbf(float " x ", float " n );
+.BI "[[deprecated]] long double scalbl(long double " x ", long double " n );
 .fi
 .P
 .RS -4
@@ -47,11 +47,11 @@ by
 .B FLT_RADIX
 (probably 2)
 to the power of
-.IR exp ,
+.IR n ,
 that is:
 .P
 .nf
-    x * FLT_RADIX ** exp
+    x * FLT_RADIX ** n
 .fi
 .P
 The definition of
@@ -65,32 +65,32 @@ On success, these functions return
 *
 .B FLT_RADIX
 **
-.IR exp .
+.IR n .
 .P
 If
 .I x
 or
-.I exp
+.I n
 is a NaN, a NaN is returned.
 .P
 If
 .I x
 is positive infinity (negative infinity),
 and
-.I exp
+.I n
 is not negative infinity,
 positive infinity (negative infinity) is returned.
 .P
 If
 .I x
 is +0 (\-0), and
-.I exp
+.I n
 is not positive infinity, +0 (\-0) is returned.
 .P
 If
 .I x
 is zero, and
-.I exp
+.I n
 is positive infinity,
 a domain error occurs, and
 a NaN is returned.
@@ -99,7 +99,7 @@ If
 .I x
 is an infinity,
 and
-.I exp
+.I n
 is negative infinity,
 a domain error occurs, and
 a NaN is returned.
@@ -126,8 +126,8 @@ when calling these functions.
 .P
 The following errors can occur:
 .TP
-Domain error: \f[I]x\f[] is 0, and \f[I]exp\f[] is positive infinity, \
-or \f[I]x\f[] is positive infinity and \f[I]exp\f[] is negative infinity \
+Domain error: \f[I]x\f[] is 0, and \f[I]n\f[] is positive infinity, \
+or \f[I]x\f[] is positive infinity and \f[I]n\f[] is negative infinity \
 and the other argument is not a NaN
 .I errno
 is set to
diff --git a/man/man3/scalbln.3 b/man/man3/scalbln.3
index e14c1be25..fbda8f4e7 100644
--- a/man/man3/scalbln.3
+++ b/man/man3/scalbln.3
@@ -14,13 +14,13 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double scalbln(double " x ", long " exp );
-.BI "float scalblnf(float " x ", long " exp );
-.BI "long double scalblnl(long double " x ", long " exp );
+.BI "double scalbln(double " x ", long " n );
+.BI "float scalblnf(float " x ", long " n );
+.BI "long double scalblnl(long double " x ", long " n );
 .P
-.BI "double scalbn(double " x ", int " exp );
-.BI "float scalbnf(float " x ", int " exp );
-.BI "long double scalbnl(long double " x ", int " exp );
+.BI "double scalbn(double " x ", int " n );
+.BI "float scalbnf(float " x ", int " n );
+.BI "long double scalbnl(long double " x ", int " n );
 .fi
 .P
 .RS -4
@@ -51,11 +51,11 @@ by
 .B FLT_RADIX
 (probably 2)
 to the power of
-.IR exp ,
+.IR n ,
 that is:
 .P
 .nf
-    x * FLT_RADIX ** exp
+    x * FLT_RADIX ** n
 .fi
 .P
 The definition of
@@ -69,7 +69,7 @@ On success, these functions return
 *
 .B FLT_RADIX
 **
-.IR exp .
+.IR n .
 .P
 If
 .I x
-- 
2.50.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-02  9:25 [PATCH] man/: Replaced reserved exp identifier Vincent Lefevre
@ 2025-07-02 14:41 ` Alejandro Colomar
  2025-07-03  2:34   ` Vincent Lefevre
  0 siblings, 1 reply; 8+ messages in thread
From: Alejandro Colomar @ 2025-07-02 14:41 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 9094 bytes --]

Hi Vincent,

On Wed, Jul 02, 2025 at 11:25:16AM +0200, Vincent Lefevre wrote:
> Since exp is a library function, this is a reserved identifier, which
> should not be used as a variable name / parameter.
> 
> For some of the replacements:
> 
> Like in ISO C23 (new in this revision), for the frexp* and ldexp*
> functions, exp is replaced by p, and for the scalb[l]n* functions,
> exp is replaced by n (thus ditto for the deprecated scalb* functions).
> 
> Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
> ---
>  man/man2/timerfd_create.2 | 16 ++++++++--------
>  man/man3/frexp.3          | 20 ++++++++++----------
>  man/man3/ldexp.3          | 12 ++++++------
>  man/man3/scalb.3          | 26 +++++++++++++-------------
>  man/man3/scalbln.3        | 18 +++++++++---------
>  5 files changed, 46 insertions(+), 46 deletions(-)
> 
> diff --git a/man/man2/timerfd_create.2 b/man/man2/timerfd_create.2
> index bcab72f37..a58b3ddfb 100644
> --- a/man/man2/timerfd_create.2
> +++ b/man/man2/timerfd_create.2
> @@ -639,12 +639,12 @@ main(int argc, char *argv[])
>  {
>      int                fd;
>      ssize_t            s;
> -    uint64_t           exp, tot_exp, max_exp;
> +    uint64_t           ex, tot_ex, max_ex;

How about using 'to' for timeout?  Do you think it makes sense?

>      struct timespec    now;
>      struct itimerspec  new_value;
>  \&
>      if (argc != 2 && argc != 4) {
> -        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
> +        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",

And here saying max\-timeout.

>                  argv[0]);
>          exit(EXIT_FAILURE);
>      }
> @@ -659,10 +659,10 @@ main(int argc, char *argv[])
>      new_value.it_value.tv_nsec = now.tv_nsec;
>      if (argc == 2) {
>          new_value.it_interval.tv_sec = 0;
> -        max_exp = 1;
> +        max_ex = 1;
>      } else {
>          new_value.it_interval.tv_sec = atoi(argv[2]);
> -        max_exp = atoi(argv[3]);
> +        max_ex = atoi(argv[3]);
>      }
>      new_value.it_interval.tv_nsec = 0;
>  \&
> @@ -676,14 +676,14 @@ main(int argc, char *argv[])
>      print_elapsed_time();
>      printf("timer started\[rs]n");
>  \&
> -    for (tot_exp = 0; tot_exp < max_exp;) {
> -        s = read(fd, &exp, sizeof(uint64_t));
> +    for (tot_ex = 0; tot_ex < max_ex;) {
> +        s = read(fd, &ex, sizeof(uint64_t));
>          if (s != sizeof(uint64_t))
>              err(EXIT_FAILURE, "read");
>  \&
> -        tot_exp += exp;
> +        tot_ex += ex;
>          print_elapsed_time();
> -        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", exp, tot_exp);
> +        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", ex, tot_ex);
>      }
>  \&
>      exit(EXIT_SUCCESS);
> diff --git a/man/man3/frexp.3 b/man/man3/frexp.3
> index a741137c2..2812798c3 100644
> --- a/man/man3/frexp.3
> +++ b/man/man3/frexp.3
> @@ -14,9 +14,9 @@ Math library
>  .nf
>  .B #include <math.h>
>  .P
> -.BI "double frexp(double " x ", int *" exp );
> -.BI "float frexpf(float " x ", int *" exp );
> -.BI "long double frexpl(long double " x ", int *" exp );
> +.BI "double frexp(double " x ", int *" p );
> +.BI "float frexpf(float " x ", int *" p );
> +.BI "long double frexpl(long double " x ", int *" p );

Here I think I'd use 'e' for exponent.  What do you think?


Have a lovely day!
Alex

>  .fi
>  .P
>  .RS -4
> @@ -36,7 +36,7 @@ These functions are used to split the number
>  .I x
>  into a
>  normalized fraction and an exponent which is stored in
> -.IR exp .
> +.IR p .
>  .SH RETURN VALUE
>  These functions return the normalized fraction.
>  If the argument
> @@ -52,20 +52,20 @@ If
>  .I x
>  is zero, then the normalized fraction is
>  zero and zero is stored in
> -.IR exp .
> +.IR p .
>  .P
>  If
>  .I x
>  is a NaN,
>  a NaN is returned, and the value of
> -.I *exp
> +.I *p
>  is unspecified.
>  .P
>  If
>  .I x
>  is positive infinity (negative infinity),
>  positive infinity (negative infinity) is returned, and the value of
> -.I *exp
> +.I *p
>  is unspecified.
>  .SH ERRORS
>  No errors occur.
> @@ -118,12 +118,12 @@ int
>  main(int argc, char *argv[])
>  {
>      double x, r;
> -    int exp;
> +    int p;
>  \&
>      x = strtod(argv[1], NULL);
> -    r = frexp(x, &exp);
> +    r = frexp(x, &p);
>  \&
> -    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, exp, x);
> +    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, p, x);
>      exit(EXIT_SUCCESS);
>  }
>  .EE
> diff --git a/man/man3/ldexp.3 b/man/man3/ldexp.3
> index c2f5289f3..daa1290f5 100644
> --- a/man/man3/ldexp.3
> +++ b/man/man3/ldexp.3
> @@ -13,9 +13,9 @@ Math library
>  .nf
>  .B #include <math.h>
>  .P
> -.BI "double ldexp(double " x ", int " exp );
> -.BI "float ldexpf(float " x ", int " exp );
> -.BI "long double ldexpl(long double " x ", int " exp );
> +.BI "double ldexp(double " x ", int " p );
> +.BI "float ldexpf(float " x ", int " p );
> +.BI "long double ldexpl(long double " x ", int " p );
>  .fi
>  .P
>  .RS -4
> @@ -34,13 +34,13 @@ Feature Test Macro Requirements for glibc (see
>  These functions return the result of multiplying the floating-point number
>  .I x
>  by 2 raised to the power
> -.IR exp .
> +.IR p .
>  .SH RETURN VALUE
>  On success, these functions return
> -.IR "x * (2\[ha]exp)" .
> +.IR "x * (2\[ha]p)" .
>  .P
>  If
> -.I exp
> +.I p
>  is zero, then
>  .I x
>  is returned.
> diff --git a/man/man3/scalb.3 b/man/man3/scalb.3
> index 6968931ba..bfa3a1f59 100644
> --- a/man/man3/scalb.3
> +++ b/man/man3/scalb.3
> @@ -15,9 +15,9 @@ Math library
>  .nf
>  .B #include <math.h>
>  .P
> -.BI "[[deprecated]] double scalb(double " x ", double " exp );
> -.BI "[[deprecated]] float scalbf(float " x ", float " exp );
> -.BI "[[deprecated]] long double scalbl(long double " x ", long double " exp );
> +.BI "[[deprecated]] double scalb(double " x ", double " n );
> +.BI "[[deprecated]] float scalbf(float " x ", float " n );
> +.BI "[[deprecated]] long double scalbl(long double " x ", long double " n );
>  .fi
>  .P
>  .RS -4
> @@ -47,11 +47,11 @@ by
>  .B FLT_RADIX
>  (probably 2)
>  to the power of
> -.IR exp ,
> +.IR n ,
>  that is:
>  .P
>  .nf
> -    x * FLT_RADIX ** exp
> +    x * FLT_RADIX ** n
>  .fi
>  .P
>  The definition of
> @@ -65,32 +65,32 @@ On success, these functions return
>  *
>  .B FLT_RADIX
>  **
> -.IR exp .
> +.IR n .
>  .P
>  If
>  .I x
>  or
> -.I exp
> +.I n
>  is a NaN, a NaN is returned.
>  .P
>  If
>  .I x
>  is positive infinity (negative infinity),
>  and
> -.I exp
> +.I n
>  is not negative infinity,
>  positive infinity (negative infinity) is returned.
>  .P
>  If
>  .I x
>  is +0 (\-0), and
> -.I exp
> +.I n
>  is not positive infinity, +0 (\-0) is returned.
>  .P
>  If
>  .I x
>  is zero, and
> -.I exp
> +.I n
>  is positive infinity,
>  a domain error occurs, and
>  a NaN is returned.
> @@ -99,7 +99,7 @@ If
>  .I x
>  is an infinity,
>  and
> -.I exp
> +.I n
>  is negative infinity,
>  a domain error occurs, and
>  a NaN is returned.
> @@ -126,8 +126,8 @@ when calling these functions.
>  .P
>  The following errors can occur:
>  .TP
> -Domain error: \f[I]x\f[] is 0, and \f[I]exp\f[] is positive infinity, \
> -or \f[I]x\f[] is positive infinity and \f[I]exp\f[] is negative infinity \
> +Domain error: \f[I]x\f[] is 0, and \f[I]n\f[] is positive infinity, \
> +or \f[I]x\f[] is positive infinity and \f[I]n\f[] is negative infinity \
>  and the other argument is not a NaN
>  .I errno
>  is set to
> diff --git a/man/man3/scalbln.3 b/man/man3/scalbln.3
> index e14c1be25..fbda8f4e7 100644
> --- a/man/man3/scalbln.3
> +++ b/man/man3/scalbln.3
> @@ -14,13 +14,13 @@ Math library
>  .nf
>  .B #include <math.h>
>  .P
> -.BI "double scalbln(double " x ", long " exp );
> -.BI "float scalblnf(float " x ", long " exp );
> -.BI "long double scalblnl(long double " x ", long " exp );
> +.BI "double scalbln(double " x ", long " n );
> +.BI "float scalblnf(float " x ", long " n );
> +.BI "long double scalblnl(long double " x ", long " n );
>  .P
> -.BI "double scalbn(double " x ", int " exp );
> -.BI "float scalbnf(float " x ", int " exp );
> -.BI "long double scalbnl(long double " x ", int " exp );
> +.BI "double scalbn(double " x ", int " n );
> +.BI "float scalbnf(float " x ", int " n );
> +.BI "long double scalbnl(long double " x ", int " n );
>  .fi
>  .P
>  .RS -4
> @@ -51,11 +51,11 @@ by
>  .B FLT_RADIX
>  (probably 2)
>  to the power of
> -.IR exp ,
> +.IR n ,
>  that is:
>  .P
>  .nf
> -    x * FLT_RADIX ** exp
> +    x * FLT_RADIX ** n
>  .fi
>  .P
>  The definition of
> @@ -69,7 +69,7 @@ On success, these functions return
>  *
>  .B FLT_RADIX
>  **
> -.IR exp .
> +.IR n .
>  .P
>  If
>  .I x
> -- 
> 2.50.0

-- 
<https://www.alejandro-colomar.es/>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-02 14:41 ` Alejandro Colomar
@ 2025-07-03  2:34   ` Vincent Lefevre
  2025-07-03  2:58     ` Alejandro Colomar
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2025-07-03  2:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

On 2025-07-02 16:41:28 +0200, Alejandro Colomar wrote:
> On Wed, Jul 02, 2025 at 11:25:16AM +0200, Vincent Lefevre wrote:
[...]
> > --- a/man/man2/timerfd_create.2
> > +++ b/man/man2/timerfd_create.2
> > @@ -639,12 +639,12 @@ main(int argc, char *argv[])
> >  {
> >      int                fd;
> >      ssize_t            s;
> > -    uint64_t           exp, tot_exp, max_exp;
> > +    uint64_t           ex, tot_ex, max_ex;
> 
> How about using 'to' for timeout?  Do you think it makes sense?

As described by the man page, this is more a timer expiration
(many occurrences of words starting with "expir") than a timeout
(a single occurrence - shouldn't this be "expiration time"?).
So, for these 3 variables, instead of "exp", perhaps "te" for
"timer expiration"?

> >      struct timespec    now;
> >      struct itimerspec  new_value;
> >  \&
> >      if (argc != 2 && argc != 4) {
> > -        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
> > +        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",
> 
> And here saying max\-timeout.

One could actually let max\-exp. Or say max\-timer\-exp (the line
would not be too large).

[...]
> > --- a/man/man3/frexp.3
> > +++ b/man/man3/frexp.3
> > @@ -14,9 +14,9 @@ Math library
> >  .nf
> >  .B #include <math.h>
> >  .P
> > -.BI "double frexp(double " x ", int *" exp );
> > -.BI "float frexpf(float " x ", int *" exp );
> > -.BI "long double frexpl(long double " x ", int *" exp );
> > +.BI "double frexp(double " x ", int *" p );
> > +.BI "float frexpf(float " x ", int *" p );
> > +.BI "long double frexpl(long double " x ", int *" p );
> 
> Here I think I'd use 'e' for exponent.  What do you think?

One could do that (this was more or less my initial idea,
and I'm wondering why the committee chose p).

BTW, for frexp, this is a pointer, while for ldexp, this is
an integer. So, should there be a difference (e.g. pe for
the pointer to the exponent, and e for the exponent)?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-03  2:34   ` Vincent Lefevre
@ 2025-07-03  2:58     ` Alejandro Colomar
  2025-07-03  8:17       ` Vincent Lefevre
  0 siblings, 1 reply; 8+ messages in thread
From: Alejandro Colomar @ 2025-07-03  2:58 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2932 bytes --]

Hi Vincent,

On Thu, Jul 03, 2025 at 04:34:51AM +0200, Vincent Lefevre wrote:
> On 2025-07-02 16:41:28 +0200, Alejandro Colomar wrote:
> > On Wed, Jul 02, 2025 at 11:25:16AM +0200, Vincent Lefevre wrote:
> [...]
> > > --- a/man/man2/timerfd_create.2
> > > +++ b/man/man2/timerfd_create.2
> > > @@ -639,12 +639,12 @@ main(int argc, char *argv[])
> > >  {
> > >      int                fd;
> > >      ssize_t            s;
> > > -    uint64_t           exp, tot_exp, max_exp;
> > > +    uint64_t           ex, tot_ex, max_ex;
> > 
> > How about using 'to' for timeout?  Do you think it makes sense?
> 
> As described by the man page, this is more a timer expiration
> (many occurrences of words starting with "expir") than a timeout
> (a single occurrence - shouldn't this be "expiration time"?).
> So, for these 3 variables, instead of "exp", perhaps "te" for
> "timer expiration"?

I still think to or te (or ex) are too unreadable (and I tend to prefer
one-letter variables when it is clear from the context, to be clear).
How about expir?

> 
> > >      struct timespec    now;
> > >      struct itimerspec  new_value;
> > >  \&
> > >      if (argc != 2 && argc != 4) {
> > > -        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
> > > +        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",
> > 
> > And here saying max\-timeout.
> 
> One could actually let max\-exp. Or say max\-timer\-exp (the line
> would not be too large).

Or timer_exp and max\-timer\-exp as you propose here.  That sounds quite
readable.

> [...]
> > > --- a/man/man3/frexp.3
> > > +++ b/man/man3/frexp.3
> > > @@ -14,9 +14,9 @@ Math library
> > >  .nf
> > >  .B #include <math.h>
> > >  .P
> > > -.BI "double frexp(double " x ", int *" exp );
> > > -.BI "float frexpf(float " x ", int *" exp );
> > > -.BI "long double frexpl(long double " x ", int *" exp );
> > > +.BI "double frexp(double " x ", int *" p );
> > > +.BI "float frexpf(float " x ", int *" p );
> > > +.BI "long double frexpl(long double " x ", int *" p );
> > 
> > Here I think I'd use 'e' for exponent.  What do you think?
> 
> One could do that (this was more or less my initial idea,
> and I'm wondering why the committee chose p).

The committee has chosen many bad names.  Let's not follow them.
Indeed, now that I'm member of the committee, I'm trying to fix that
among other things.

Here's one of my proposals for fixing names in the standard:
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3577.txt>

But there's much more than that coming soon.

> BTW, for frexp, this is a pointer, while for ldexp, this is
> an integer. So, should there be a difference (e.g. pe for
> the pointer to the exponent, and e for the exponent)?

Hmmmm, I think not.  From the context it should be obvious.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-03  2:58     ` Alejandro Colomar
@ 2025-07-03  8:17       ` Vincent Lefevre
  2025-07-03 16:28         ` Alejandro Colomar
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2025-07-03  8:17 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Hi Alejandro,

On 2025-07-03 04:58:03 +0200, Alejandro Colomar wrote:
> Hi Vincent,
> 
> On Thu, Jul 03, 2025 at 04:34:51AM +0200, Vincent Lefevre wrote:
> > On 2025-07-02 16:41:28 +0200, Alejandro Colomar wrote:
> > > On Wed, Jul 02, 2025 at 11:25:16AM +0200, Vincent Lefevre wrote:
> > [...]
> > > > --- a/man/man2/timerfd_create.2
> > > > +++ b/man/man2/timerfd_create.2
> > > > @@ -639,12 +639,12 @@ main(int argc, char *argv[])
> > > >  {
> > > >      int                fd;
> > > >      ssize_t            s;
> > > > -    uint64_t           exp, tot_exp, max_exp;
> > > > +    uint64_t           ex, tot_ex, max_ex;
> > > 
> > > How about using 'to' for timeout?  Do you think it makes sense?
> > 
> > As described by the man page, this is more a timer expiration
> > (many occurrences of words starting with "expir") than a timeout
> > (a single occurrence - shouldn't this be "expiration time"?).
> > So, for these 3 variables, instead of "exp", perhaps "te" for
> > "timer expiration"?
> 
> I still think to or te (or ex) are too unreadable (and I tend to prefer
> one-letter variables when it is clear from the context, to be clear).
> How about expir?

OK for expir (with the reformatting of a line that would become
too long as a consequence). That's even clearer than exp.

> > > >      struct timespec    now;
> > > >      struct itimerspec  new_value;
> > > >  \&
> > > >      if (argc != 2 && argc != 4) {
> > > > -        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
> > > > +        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",
> > > 
> > > And here saying max\-timeout.
> > 
> > One could actually let max\-exp. Or say max\-timer\-exp (the line
> > would not be too large).
> 
> Or timer_exp and max\-timer\-exp as you propose here.  That sounds quite
> readable.

The use of "max" in the name is important as there are several
timer expirations and one gives here the maximum number of such
expirations. It could also be "max\-expir" or "max\-#expir"[*].
What do you think?

[*] https://academia.stackexchange.com/questions/90816/abbreviation-of-number-of-in-a-table-heading

> > [...]
> > > > --- a/man/man3/frexp.3
> > > > +++ b/man/man3/frexp.3
> > > > @@ -14,9 +14,9 @@ Math library
> > > >  .nf
> > > >  .B #include <math.h>
> > > >  .P
> > > > -.BI "double frexp(double " x ", int *" exp );
> > > > -.BI "float frexpf(float " x ", int *" exp );
> > > > -.BI "long double frexpl(long double " x ", int *" exp );
> > > > +.BI "double frexp(double " x ", int *" p );
> > > > +.BI "float frexpf(float " x ", int *" p );
> > > > +.BI "long double frexpl(long double " x ", int *" p );
> > > 
> > > Here I think I'd use 'e' for exponent.  What do you think?
> > 
> > One could do that (this was more or less my initial idea,
> > and I'm wondering why the committee chose p).
> 
> The committee has chosen many bad names.  Let's not follow them.
> Indeed, now that I'm member of the committee, I'm trying to fix that
> among other things.

Great. FYI, here's what I sent to the CFP list yesterday, as there
are also remaining "exp" in the standard:

────────────────────────────────────────────────────────────────────────
In ISO C23 and still in the N3550 C2y draft, B.11 (<math.h>)
and H.11.3p1:

_FloatN frexpfN(_FloatN value, int *exp);
_FloatNx frexpfNx(_FloatNx value, int *exp);
_DecimalN frexpdN(_DecimalN value, int *exp);
_DecimalNx frexpdNx(_DecimalNx value, int *exp);

and

_FloatN ldexpfN(_FloatN value, int exp);
_FloatNx ldexpfNx(_FloatNx value, int exp);
_DecimalN ldexpdN(_DecimalN value, int exp);
_DecimalNx ldexpdNx(_DecimalNx value, int exp);

and

_FloatN scalbnfN(_FloatN value, int exp);
_FloatNx scalbnfNx(_FloatNx value, int exp);
_DecimalN scalbndN(_DecimalN value, int exp);
_DecimalNx scalbndNx(_DecimalNx value, int exp);
_FloatN scalblnfN(_FloatN value, long int exp);
_FloatNx scalblnfNx(_FloatNx value, long int exp);
_DecimalN scalblndN(_DecimalN value, long int exp);
_DecimalNx scalblndNx(_DecimalNx value, long int exp);

However, exp is a standard library function, thus the exp identifier
is reserved for any use. So the above prototypes are incorrect.

Earlier, one has:

double frexp(double value, int *p);
float frexpf(float value, int *p);
long double frexpl(long double value, int *p);

double ldexp(double x, int p);
float ldexpf(float x, int p);
long double ldexpl(long double x, int p);

double scalbn(double x, int n);
float scalbnf(float x, int n);
long double scalbnl(long double x, int n);
double scalbln(double x, long int n);
float scalblnf(float x, long int n);
long double scalblnl(long double x, long int n);

So, for consistency, p and n could be used respectively,
instead of exp.

H.11.3p2 and H.11.3p3 would also need to be updated.

Also in F.10.4.9:

"On a binary system, ldexp(x, exp) is equivalent to scalbn(x, exp)."

BTW, there is a similar issue in 7.17.7.5p7, which contains the
following example:

  exp = atomic_load(&cur);
  do {
        des = function(exp);
  } while (!atomic_compare_exchange_weak(&cur, &exp, des));
────────────────────────────────────────────────────────────────────────

> > BTW, for frexp, this is a pointer, while for ldexp, this is
> > an integer. So, should there be a difference (e.g. pe for
> > the pointer to the exponent, and e for the exponent)?
> 
> Hmmmm, I think not.  From the context it should be obvious.

So, OK for "e".

Regards,

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-03  8:17       ` Vincent Lefevre
@ 2025-07-03 16:28         ` Alejandro Colomar
  2025-07-12 21:23           ` Vincent Lefevre
  0 siblings, 1 reply; 8+ messages in thread
From: Alejandro Colomar @ 2025-07-03 16:28 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 4746 bytes --]

Hi Vincent,

On Thu, Jul 03, 2025 at 10:17:17AM +0200, Vincent Lefevre wrote:
> Hi Alejandro,
> 
> On 2025-07-03 04:58:03 +0200, Alejandro Colomar wrote:
> > Hi Vincent,
> > 
> > On Thu, Jul 03, 2025 at 04:34:51AM +0200, Vincent Lefevre wrote:
> > > On 2025-07-02 16:41:28 +0200, Alejandro Colomar wrote:
> > > > On Wed, Jul 02, 2025 at 11:25:16AM +0200, Vincent Lefevre wrote:
> > > [...]
> > > > > --- a/man/man2/timerfd_create.2
> > > > > +++ b/man/man2/timerfd_create.2
> > > > > @@ -639,12 +639,12 @@ main(int argc, char *argv[])
> > > > >  {
> > > > >      int                fd;
> > > > >      ssize_t            s;
> > > > > -    uint64_t           exp, tot_exp, max_exp;
> > > > > +    uint64_t           ex, tot_ex, max_ex;
> > > > 
> > > > How about using 'to' for timeout?  Do you think it makes sense?
> > > 
> > > As described by the man page, this is more a timer expiration
> > > (many occurrences of words starting with "expir") than a timeout
> > > (a single occurrence - shouldn't this be "expiration time"?).
> > > So, for these 3 variables, instead of "exp", perhaps "te" for
> > > "timer expiration"?
> > 
> > I still think to or te (or ex) are too unreadable (and I tend to prefer
> > one-letter variables when it is clear from the context, to be clear).
> > How about expir?
> 
> OK for expir (with the reformatting of a line that would become
> too long as a consequence). That's even clearer than exp.
> 
> > > > >      struct timespec    now;
> > > > >      struct itimerspec  new_value;
> > > > >  \&
> > > > >      if (argc != 2 && argc != 4) {
> > > > > -        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
> > > > > +        fprintf(stderr, "%s init\-secs [interval\-secs max\-ex]\[rs]n",
> > > > 
> > > > And here saying max\-timeout.
> > > 
> > > One could actually let max\-exp. Or say max\-timer\-exp (the line
> > > would not be too large).
> > 
> > Or timer_exp and max\-timer\-exp as you propose here.  That sounds quite
> > readable.
> 
> The use of "max" in the name is important as there are several
> timer expirations and one gives here the maximum number of such
> expirations. It could also be "max\-expir" or "max\-#expir"[*].
> What do you think?

How about max-num-expir?

> 
> [*] https://academia.stackexchange.com/questions/90816/abbreviation-of-number-of-in-a-table-heading
> 
> > > [...]
> > > > > --- a/man/man3/frexp.3
> > > > > +++ b/man/man3/frexp.3
> > > > > @@ -14,9 +14,9 @@ Math library
> > > > >  .nf
> > > > >  .B #include <math.h>
> > > > >  .P
> > > > > -.BI "double frexp(double " x ", int *" exp );
> > > > > -.BI "float frexpf(float " x ", int *" exp );
> > > > > -.BI "long double frexpl(long double " x ", int *" exp );
> > > > > +.BI "double frexp(double " x ", int *" p );
> > > > > +.BI "float frexpf(float " x ", int *" p );
> > > > > +.BI "long double frexpl(long double " x ", int *" p );
> > > > 
> > > > Here I think I'd use 'e' for exponent.  What do you think?
> > > 
> > > One could do that (this was more or less my initial idea,
> > > and I'm wondering why the committee chose p).
> > 
> > The committee has chosen many bad names.  Let's not follow them.
> > Indeed, now that I'm member of the committee, I'm trying to fix that
> > among other things.
> 
> Great. FYI, here's what I sent to the CFP list yesterday, as there
> are also remaining "exp" in the standard:

Do you want me to write a proposal?  Or will the CFP write one?


Have a lovely day!
Alex

> ────────────────────────────────────────────────────────────────────────

[...]

> However, exp is a standard library function, thus the exp identifier
> is reserved for any use. So the above prototypes are incorrect.

[...]

> ────────────────────────────────────────────────────────────────────────
> 
> > > BTW, for frexp, this is a pointer, while for ldexp, this is
> > > an integer. So, should there be a difference (e.g. pe for
> > > the pointer to the exponent, and e for the exponent)?
> > 
> > Hmmmm, I think not.  From the context it should be obvious.
> 
> So, OK for "e".
> 
> Regards,
> 
> -- 
> Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

-- 
<https://www.alejandro-colomar.es/>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-03 16:28         ` Alejandro Colomar
@ 2025-07-12 21:23           ` Vincent Lefevre
  2025-07-19 13:42             ` Alejandro Colomar
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2025-07-12 21:23 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]

Hi Alejandro,

On 2025-07-03 18:28:49 +0200, Alejandro Colomar wrote:
> On Thu, Jul 03, 2025 at 10:17:17AM +0200, Vincent Lefevre wrote:
> > The use of "max" in the name is important as there are several
> > timer expirations and one gives here the maximum number of such
> > expirations. It could also be "max\-expir" or "max\-#expir"[*].
> > What do you think?
> 
> How about max-num-expir?

OK.

I've attached a new version of my patch.

> > > > One could do that (this was more or less my initial idea,
> > > > and I'm wondering why the committee chose p).
> > > 
> > > The committee has chosen many bad names.  Let's not follow them.
> > > Indeed, now that I'm member of the committee, I'm trying to fix that
> > > among other things.
> > 
> > Great. FYI, here's what I sent to the CFP list yesterday, as there
> > are also remaining "exp" in the standard:
> 
> Do you want me to write a proposal?  Or will the CFP write one?

There hasn't been any reaction to my mail in the CFP list.
So perhaps you could write a proposal.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[-- Attachment #2: reserved-exp-2.patch --]
[-- Type: text/plain, Size: 7887 bytes --]

From d5c365eb0a5c3c14655467e6e528c7360dd5c0a5 Mon Sep 17 00:00:00 2001
From: Vincent Lefevre <vincent@vinc17.net>
Date: Sat, 12 Jul 2025 23:05:00 +0200
Subject: [PATCH] man/: Replaced reserved exp identifier

Since exp is a library function, this is a reserved identifier, which
should not be used as a variable name / parameter.

Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
---
 man/man2/timerfd_create.2 | 17 +++++++++--------
 man/man3/frexp.3          | 20 ++++++++++----------
 man/man3/ldexp.3          | 12 ++++++------
 man/man3/scalb.3          | 26 +++++++++++++-------------
 man/man3/scalbln.3        | 18 +++++++++---------
 5 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/man/man2/timerfd_create.2 b/man/man2/timerfd_create.2
index bcab72f37..7f9d0f039 100644
--- a/man/man2/timerfd_create.2
+++ b/man/man2/timerfd_create.2
@@ -639,12 +639,12 @@ main(int argc, char *argv[])
 {
     int                fd;
     ssize_t            s;
-    uint64_t           exp, tot_exp, max_exp;
+    uint64_t           expir, tot_expir, max_expir;
     struct timespec    now;
     struct itimerspec  new_value;
 \&
     if (argc != 2 && argc != 4) {
-        fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
+        fprintf(stderr, "%s init\-secs [interval\-secs max\-num\-expir]\[rs]n",
                 argv[0]);
         exit(EXIT_FAILURE);
     }
@@ -659,10 +659,10 @@ main(int argc, char *argv[])
     new_value.it_value.tv_nsec = now.tv_nsec;
     if (argc == 2) {
         new_value.it_interval.tv_sec = 0;
-        max_exp = 1;
+        max_expir = 1;
     } else {
         new_value.it_interval.tv_sec = atoi(argv[2]);
-        max_exp = atoi(argv[3]);
+        max_expir = atoi(argv[3]);
     }
     new_value.it_interval.tv_nsec = 0;
 \&
@@ -676,14 +676,15 @@ main(int argc, char *argv[])
     print_elapsed_time();
     printf("timer started\[rs]n");
 \&
-    for (tot_exp = 0; tot_exp < max_exp;) {
-        s = read(fd, &exp, sizeof(uint64_t));
+    for (tot_expir = 0; tot_expir < max_expir;) {
+        s = read(fd, &expir, sizeof(uint64_t));
         if (s != sizeof(uint64_t))
             err(EXIT_FAILURE, "read");
 \&
-        tot_exp += exp;
+        tot_expir += expir;
         print_elapsed_time();
-        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", exp, tot_exp);
+        printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n",
+               expir, tot_expir);
     }
 \&
     exit(EXIT_SUCCESS);
diff --git a/man/man3/frexp.3 b/man/man3/frexp.3
index a741137c2..304095d2b 100644
--- a/man/man3/frexp.3
+++ b/man/man3/frexp.3
@@ -14,9 +14,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double frexp(double " x ", int *" exp );
-.BI "float frexpf(float " x ", int *" exp );
-.BI "long double frexpl(long double " x ", int *" exp );
+.BI "double frexp(double " x ", int *" e );
+.BI "float frexpf(float " x ", int *" e );
+.BI "long double frexpl(long double " x ", int *" e );
 .fi
 .P
 .RS -4
@@ -36,7 +36,7 @@ These functions are used to split the number
 .I x
 into a
 normalized fraction and an exponent which is stored in
-.IR exp .
+.IR e .
 .SH RETURN VALUE
 These functions return the normalized fraction.
 If the argument
@@ -52,20 +52,20 @@ If
 .I x
 is zero, then the normalized fraction is
 zero and zero is stored in
-.IR exp .
+.IR e .
 .P
 If
 .I x
 is a NaN,
 a NaN is returned, and the value of
-.I *exp
+.I *e
 is unspecified.
 .P
 If
 .I x
 is positive infinity (negative infinity),
 positive infinity (negative infinity) is returned, and the value of
-.I *exp
+.I *e
 is unspecified.
 .SH ERRORS
 No errors occur.
@@ -118,12 +118,12 @@ int
 main(int argc, char *argv[])
 {
     double x, r;
-    int exp;
+    int e;
 \&
     x = strtod(argv[1], NULL);
-    r = frexp(x, &exp);
+    r = frexp(x, &e);
 \&
-    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, exp, x);
+    printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, e, x);
     exit(EXIT_SUCCESS);
 }
 .EE
diff --git a/man/man3/ldexp.3 b/man/man3/ldexp.3
index c2f5289f3..6bae52c80 100644
--- a/man/man3/ldexp.3
+++ b/man/man3/ldexp.3
@@ -13,9 +13,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double ldexp(double " x ", int " exp );
-.BI "float ldexpf(float " x ", int " exp );
-.BI "long double ldexpl(long double " x ", int " exp );
+.BI "double ldexp(double " x ", int " e );
+.BI "float ldexpf(float " x ", int " e );
+.BI "long double ldexpl(long double " x ", int " e );
 .fi
 .P
 .RS -4
@@ -34,13 +34,13 @@ Feature Test Macro Requirements for glibc (see
 These functions return the result of multiplying the floating-point number
 .I x
 by 2 raised to the power
-.IR exp .
+.IR e .
 .SH RETURN VALUE
 On success, these functions return
-.IR "x * (2\[ha]exp)" .
+.IR "x * (2\[ha]e)" .
 .P
 If
-.I exp
+.I e
 is zero, then
 .I x
 is returned.
diff --git a/man/man3/scalb.3 b/man/man3/scalb.3
index 6968931ba..2d1ed17c6 100644
--- a/man/man3/scalb.3
+++ b/man/man3/scalb.3
@@ -15,9 +15,9 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "[[deprecated]] double scalb(double " x ", double " exp );
-.BI "[[deprecated]] float scalbf(float " x ", float " exp );
-.BI "[[deprecated]] long double scalbl(long double " x ", long double " exp );
+.BI "[[deprecated]] double scalb(double " x ", double " e );
+.BI "[[deprecated]] float scalbf(float " x ", float " e );
+.BI "[[deprecated]] long double scalbl(long double " x ", long double " e );
 .fi
 .P
 .RS -4
@@ -47,11 +47,11 @@ by
 .B FLT_RADIX
 (probably 2)
 to the power of
-.IR exp ,
+.IR e ,
 that is:
 .P
 .nf
-    x * FLT_RADIX ** exp
+    x * FLT_RADIX ** e
 .fi
 .P
 The definition of
@@ -65,32 +65,32 @@ On success, these functions return
 *
 .B FLT_RADIX
 **
-.IR exp .
+.IR e .
 .P
 If
 .I x
 or
-.I exp
+.I e
 is a NaN, a NaN is returned.
 .P
 If
 .I x
 is positive infinity (negative infinity),
 and
-.I exp
+.I e
 is not negative infinity,
 positive infinity (negative infinity) is returned.
 .P
 If
 .I x
 is +0 (\-0), and
-.I exp
+.I e
 is not positive infinity, +0 (\-0) is returned.
 .P
 If
 .I x
 is zero, and
-.I exp
+.I e
 is positive infinity,
 a domain error occurs, and
 a NaN is returned.
@@ -99,7 +99,7 @@ If
 .I x
 is an infinity,
 and
-.I exp
+.I e
 is negative infinity,
 a domain error occurs, and
 a NaN is returned.
@@ -126,8 +126,8 @@ when calling these functions.
 .P
 The following errors can occur:
 .TP
-Domain error: \f[I]x\f[] is 0, and \f[I]exp\f[] is positive infinity, \
-or \f[I]x\f[] is positive infinity and \f[I]exp\f[] is negative infinity \
+Domain error: \f[I]x\f[] is 0, and \f[I]e\f[] is positive infinity, \
+or \f[I]x\f[] is positive infinity and \f[I]e\f[] is negative infinity \
 and the other argument is not a NaN
 .I errno
 is set to
diff --git a/man/man3/scalbln.3 b/man/man3/scalbln.3
index e14c1be25..1981fdb40 100644
--- a/man/man3/scalbln.3
+++ b/man/man3/scalbln.3
@@ -14,13 +14,13 @@ Math library
 .nf
 .B #include <math.h>
 .P
-.BI "double scalbln(double " x ", long " exp );
-.BI "float scalblnf(float " x ", long " exp );
-.BI "long double scalblnl(long double " x ", long " exp );
+.BI "double scalbln(double " x ", long " e );
+.BI "float scalblnf(float " x ", long " e );
+.BI "long double scalblnl(long double " x ", long " e );
 .P
-.BI "double scalbn(double " x ", int " exp );
-.BI "float scalbnf(float " x ", int " exp );
-.BI "long double scalbnl(long double " x ", int " exp );
+.BI "double scalbn(double " x ", int " e );
+.BI "float scalbnf(float " x ", int " e );
+.BI "long double scalbnl(long double " x ", int " e );
 .fi
 .P
 .RS -4
@@ -51,11 +51,11 @@ by
 .B FLT_RADIX
 (probably 2)
 to the power of
-.IR exp ,
+.IR e ,
 that is:
 .P
 .nf
-    x * FLT_RADIX ** exp
+    x * FLT_RADIX ** e
 .fi
 .P
 The definition of
@@ -69,7 +69,7 @@ On success, these functions return
 *
 .B FLT_RADIX
 **
-.IR exp .
+.IR e .
 .P
 If
 .I x
-- 
2.50.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] man/: Replaced reserved exp identifier
  2025-07-12 21:23           ` Vincent Lefevre
@ 2025-07-19 13:42             ` Alejandro Colomar
  0 siblings, 0 replies; 8+ messages in thread
From: Alejandro Colomar @ 2025-07-19 13:42 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]

Hi Vincent,

On Sat, Jul 12, 2025 at 11:23:22PM +0200, Vincent Lefevre wrote:
> Hi Alejandro,
> 
> On 2025-07-03 18:28:49 +0200, Alejandro Colomar wrote:
> > On Thu, Jul 03, 2025 at 10:17:17AM +0200, Vincent Lefevre wrote:
> > > The use of "max" in the name is important as there are several
> > > timer expirations and one gives here the maximum number of such
> > > expirations. It could also be "max\-expir" or "max\-#expir"[*].
> > > What do you think?
> > 
> > How about max-num-expir?
> 
> OK.
> 
> I've attached a new version of my patch.

Thanks!  I've applied the patch.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=26e5c43a99ac2c0c01845131d3fbc8e375610b09>
 
> > > > > One could do that (this was more or less my initial idea,
> > > > > and I'm wondering why the committee chose p).
> > > > 
> > > > The committee has chosen many bad names.  Let's not follow them.
> > > > Indeed, now that I'm member of the committee, I'm trying to fix that
> > > > among other things.
> > > 
> > > Great. FYI, here's what I sent to the CFP list yesterday, as there
> > > are also remaining "exp" in the standard:
> > 
> > Do you want me to write a proposal?  Or will the CFP write one?
> 
> There hasn't been any reaction to my mail in the CFP list.
> So perhaps you could write a proposal.

They didn't reply to my paper either.  I'll have to ask for an N number.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-19 13:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  9:25 [PATCH] man/: Replaced reserved exp identifier Vincent Lefevre
2025-07-02 14:41 ` Alejandro Colomar
2025-07-03  2:34   ` Vincent Lefevre
2025-07-03  2:58     ` Alejandro Colomar
2025-07-03  8:17       ` Vincent Lefevre
2025-07-03 16:28         ` Alejandro Colomar
2025-07-12 21:23           ` Vincent Lefevre
2025-07-19 13:42             ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox