* [Ada] Fix glitch in comment of System.Powten_Table
@ 2020-12-16 13:15 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-12-16 13:15 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
There is a typo in the formula to compute Maxpow exposed in the comment.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/s-powtab.ads (Maxpow): Use explicit formula in comment.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 936 bytes --]
diff --git a/gcc/ada/libgnat/s-powtab.ads b/gcc/ada/libgnat/s-powtab.ads
--- a/gcc/ada/libgnat/s-powtab.ads
+++ b/gcc/ada/libgnat/s-powtab.ads
@@ -36,9 +36,9 @@ package System.Powten_Table is
Maxpow : constant := 22;
-- The number of entries in this table is chosen to include powers of ten
- -- that are exactly representable with long_long_float. Assuming that on
- -- all targets we have 53 bits of mantissa for the type, the upper bound is
- -- given by 53/(log 5). If the scaling factor for a string is greater than
+ -- that are exactly representable with Long_Long_Float. Assuming that on
+ -- all targets we have 53 bits of mantissa for the type, the upper bound
+ -- is given by 53 * log 2 / log 5. If the scaling factor is greater than
-- Maxpow, it can be obtained by several multiplications, which is less
-- efficient than with a bigger table, but avoids anomalies at end points.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-16 13:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:15 [Ada] Fix glitch in comment of System.Powten_Table Pierre-Marie de Rodat
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).