From d4506716bcd7e43d998deaa54739e1df4175e050 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 19 Sep 2020 10:42:51 +0200 Subject: [PATCH] [Ada] Another small edition to documentation of Ada.Text_IO.Fixed_IO gcc/ada/ * libgnat/a-tifiio.adb: Move around documentaton paragraph. --- gcc/ada/libgnat/a-tifiio.adb | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/gcc/ada/libgnat/a-tifiio.adb b/gcc/ada/libgnat/a-tifiio.adb index f48239f..f6777f6 100644 --- a/gcc/ada/libgnat/a-tifiio.adb +++ b/gcc/ada/libgnat/a-tifiio.adb @@ -140,21 +140,6 @@ -- solution. The downside however may be a too limited set of acceptable -- fixed point types. --- Extra Precision --- --------------- - --- Using a scaled divide which truncates and returns a remainder R, --- another E trailing digits can be calculated by computing the value --- (R * (10.0**E)) / Z using another scaled divide. This procedure --- can be repeated to compute an arbitrary number of digits in linear --- time and storage. The last scaled divide should be rounded, with --- a possible carry propagating to the more significant digits, to --- ensure correct rounding of the unit in the last place. - --- An extension of this technique is to limit the value of Q to 9 decimal --- digits, since 32-bit integers can be much more efficient than 64-bit --- integers to output. - with Interfaces; use Interfaces; with System.Arith_64; use System.Arith_64; with System.Img_Real; use System.Img_Real; @@ -260,6 +245,20 @@ package body Ada.Text_IO.Fixed_IO is -- in the denominator for the extra decimal scaling required, so case (3) -- will not overflow. + -- Extra Precision + + -- Using a scaled divide which truncates and returns a remainder R, + -- another E trailing digits can be calculated by computing the value + -- (R * (10.0**E)) / Z using another scaled divide. This procedure + -- can be repeated to compute an arbitrary number of digits in linear + -- time and storage. The last scaled divide should be rounded, with + -- a possible carry propagating to the more significant digits, to + -- ensure correct rounding of the unit in the last place. + + -- A variant of this technique is to limit the value of Q to 9 decimal + -- digits, since 32-bit integers can be much more efficient than 64-bit + -- integers to output. + pragma Assert (System.Fine_Delta >= 2.0**(-63)); pragma Assert (Num'Small in 2.0**(-80) .. 2.0**80); pragma Assert (Num'Fore <= 37); -- 2.7.4