All of lore.kernel.org
 help / color / mirror / Atom feed
* (same) errors in ceil.3, floor.3, rint.3, and round.3
@ 2022-04-27  9:15 Dr. Wolfgang Armbruster
  2022-04-27 11:52 ` Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Dr. Wolfgang Armbruster @ 2022-04-27  9:15 UTC (permalink / raw)
  To: mtk.manpages, alx.manpages; +Cc: linux-man

Hello Mr. Kerrisk, hello Mr. Colomar,

There are the same errors in ceil.3, floor.3, rint.3, and round.3
within the "NOTES"-section, e.g. floor.3, lines 111 - 115:

...
(More precisely, overflow can happen only when the maximum value
of the exponent is smaller than the number of mantissa bits.
For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
the maximum value of the exponent is 128 (respectively, 1024),
and the number of mantissa bits is 24 (respectively, 53).)
...


1) According to IEEE 754 - 2008 , section 3.3, table 3.2
https://irem.univ-reunion.fr/IMG/pdf/ieee-754-2008.pdf
the value of emax is described as
emax = +127 / +1023

Section "Basic and interchange formats" at
https://en.wikipedia.org/wiki/IEEE_754
states the same values.

Thus, I suggest: line 114

the maximum value of the exponent is 127 (respectively, 1023),



2) To be more precise at line 115, I suggest:

and the number of mantissa bits including the implicit bit is 24 
(respectively, 53)



I'm using OpenSUSE 15.3
but the text is identical to the online man-page
https://man7.org/linux/man-pages/man3/floor.3.html
and I just cloned
git clone https://git.kernel.org/pub/scm/docs/man-pages/man-pages
the actual man-pages.


Yours,

Dr. Wolfgang Armbruster


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

* Re: (same) errors in ceil.3, floor.3, rint.3, and round.3
  2022-04-27  9:15 (same) errors in ceil.3, floor.3, rint.3, and round.3 Dr. Wolfgang Armbruster
@ 2022-04-27 11:52 ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2022-04-27 11:52 UTC (permalink / raw)
  To: Dr. Wolfgang Armbruster; +Cc: linux-man, mtk.manpages

Hello Dr. Wolfgang Armbruster,

Thanks for the precise report.
I applied the following patch.

Thanks,

Alex

---

     ceil.3, floor.3, rint.3, round.3: Fix floating-point limit values

     According to IEEE 754 - 2008 , section 3.3, table 3.2
     <https://irem.univ-reunion.fr/IMG/pdf/ieee-754-2008.pdf>
     the value of emax is described as
     emax = +127 / +1023

     <https://en.wikipedia.org/wiki/IEEE_754#Basic_and_interchange_formats>
     states the same values.

     Also, to be more precise about the number of mantissa bits,
     clarify that the implicit bit is included in the count.

     Reported-by: "Dr. Wolfgang Armbruster" <dr.w.e.armbruster@gmail.com>
     Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

diff --git a/man3/ceil.3 b/man3/ceil.3
index a01b75c5e..1b83258c1 100644
--- a/man3/ceil.3
+++ b/man3/ceil.3
@@ -93,8 +93,10 @@ so this error-handling stuff is just nonsense.
  (More precisely, overflow can happen only when the maximum value
  of the exponent is smaller than the number of mantissa bits.
  For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
-the maximum value of the exponent is 128 (respectively, 1024),
-and the number of mantissa bits is 24 (respectively, 53).)
+the maximum value of the exponent is 127 (respectively, 1023),
+and the number of mantissa bits
+including the implicit bit
+is 24 (respectively, 53).)
  .PP
  The integral value returned by these functions may be too large
  to store in an integer type
diff --git a/man3/floor.3 b/man3/floor.3
index f502be22f..d64e4a512 100644
--- a/man3/floor.3
+++ b/man3/floor.3
@@ -92,8 +92,10 @@ so this error-handling stuff is just nonsense.
  (More precisely, overflow can happen only when the maximum value
  of the exponent is smaller than the number of mantissa bits.
  For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
-the maximum value of the exponent is 128 (respectively, 1024),
-and the number of mantissa bits is 24 (respectively, 53).)
+the maximum value of the exponent is 127 (respectively, 1023),
+and the number of mantissa bits
+including the implicit bit
+is 24 (respectively, 53).)
  .SH SEE ALSO
  .BR ceil (3),
  .BR lrint (3),
diff --git a/man3/rint.3 b/man3/rint.3
index 70d2205d2..a15ca0d79 100644
--- a/man3/rint.3
+++ b/man3/rint.3
@@ -128,8 +128,10 @@ so this error-handling stuff is just nonsense.
  (More precisely, overflow can happen only when the maximum value
  of the exponent is smaller than the number of mantissa bits.
  For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
-the maximum value of the exponent is 128 (respectively, 1024),
-and the number of mantissa bits is 24 (respectively, 53).)
+the maximum value of the exponent is 127 (respectively, 1023),
+and the number of mantissa bits
+including the implicit bit
+is 24 (respectively, 53).)
  .PP
  If you want to store the rounded value in an integer type,
  you probably want to use one of the functions described in
diff --git a/man3/round.3 b/man3/round.3
index 5b6169823..a3968ca88 100644
--- a/man3/round.3
+++ b/man3/round.3
@@ -93,8 +93,10 @@ so this error-handling stuff is just nonsense.
  (More precisely, overflow can happen only when the maximum value
  of the exponent is smaller than the number of mantissa bits.
  For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
-the maximum value of the exponent is 128 (respectively, 1024),
-and the number of mantissa bits is 24 (respectively, 53).)
+the maximum value of the exponent is 127 (respectively, 1023),
+and the number of mantissa bits
+including the implicit bit
+is 24 (respectively, 53).)
  .PP
  If you want to store the rounded value in an integer type,
  you probably want to use one of the functions described in

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

end of thread, other threads:[~2022-04-27 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27  9:15 (same) errors in ceil.3, floor.3, rint.3, and round.3 Dr. Wolfgang Armbruster
2022-04-27 11:52 ` Alejandro Colomar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.