diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2025-01-06 09:09:49 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-13 11:52:57 +0100 |
commit | d2e3635aa1820346050b85009df82a60cdd8206f (patch) | |
tree | bf24b137643274e69e66ddd6229eae63cf5f0c09 | |
parent | 26b649b2d17dccf0f4c3c048f37c49660aad7f71 (diff) | |
download | gcc-d2e3635aa1820346050b85009df82a60cdd8206f.zip gcc-d2e3635aa1820346050b85009df82a60cdd8206f.tar.gz gcc-d2e3635aa1820346050b85009df82a60cdd8206f.tar.bz2 |
ada: Add more commentary to System.Val_Real.Large_Powfive
gcc/ada/ChangeLog:
* libgnat/s-valrea.adb (Large_Powfive) [2 parameters]: Add a couple
of additional comments.
-rw-r--r-- | gcc/ada/libgnat/s-valrea.adb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/s-valrea.adb b/gcc/ada/libgnat/s-valrea.adb index ed22366..aff694d 100644 --- a/gcc/ada/libgnat/s-valrea.adb +++ b/gcc/ada/libgnat/s-valrea.adb @@ -396,6 +396,9 @@ package body System.Val_Real is begin pragma Assert (Exp > Maxexp); + -- This routine supports any type but it is not necessary to invoke it + -- for large types because the above one is sufficient for them. + pragma Warnings (Off, "-gnatw.a"); pragma Assert (not Is_Large_Type); pragma Warnings (On, "-gnatw.a"); @@ -407,6 +410,8 @@ package body System.Val_Real is -- its final value does not overflow but, if it's too large, then do not -- bother doing it since overflow is just fine. The scaling factor is -3 -- for every power of 5 above the maximum, in other words division by 8. + -- Note that Maxpow is an upper bound of the span of exponents for which + -- scaling is needed, but it's OK to apply it even if it is not needed. if Exp - Maxexp <= Maxpow then S := 3 * (Exp - Maxexp); |