From: Eric Botcazou <ebotca...@adacore.com>

This uses truncation for all bases instead of for base 10 only.

gcc/ada/ChangeLog:

        * libgnat/s-valued.adb (Integer_to_Decimal): Use truncation for the
        scaled divide operation performed for bases other than 10.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/libgnat/s-valued.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/libgnat/s-valued.adb b/gcc/ada/libgnat/s-valued.adb
index 4f2e1020466..b7982b6046f 100644
--- a/gcc/ada/libgnat/s-valued.adb
+++ b/gcc/ada/libgnat/s-valued.adb
@@ -228,9 +228,9 @@ package body System.Value_D is
                raise Program_Error;
             end if;
 
-            --  Perform a scaled divide operation with rounding to match 'Image
+            --  Perform a scaled divide operation with truncation
 
-            Scaled_Divide (To_Signed (V), Y, Z, Q, R, Round => True);
+            Scaled_Divide (To_Signed (V), Y, Z, Q, R, Round => False);
 
             return Q;
          end;
-- 
2.43.0

Reply via email to