From 0ef4195c17fe7b0b755686b13f65b57eff12dfe4 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 26 May 2025 23:56:47 +0200 Subject: [PATCH] ada: Use consistent truncation of 'Value for decimal fixed-point types 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 | 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.47.3