]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Use consistent truncation of 'Value for decimal fixed-point types
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 26 May 2025 21:56:47 +0000 (23:56 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:17 +0000 (10:16 +0200)
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.

gcc/ada/libgnat/s-valued.adb

index 4f2e102046688945a84a94d456716abd99d91e21..b7982b6046f7d30877e83f32e6e4267a24a8c363 100644 (file)
@@ -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;