diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-11-26 15:58:24 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-15 06:41:57 -0500 |
commit | 2224729c890681365d1844e102d7db114e2251cc (patch) | |
tree | 550dde9322ea2e475c478585798c1fa802522298 /gcc | |
parent | 7d07d75d69d8d145329b6a81db1fc74f4e3c812b (diff) | |
download | gcc-2224729c890681365d1844e102d7db114e2251cc.zip gcc-2224729c890681365d1844e102d7db114e2251cc.tar.gz gcc-2224729c890681365d1844e102d7db114e2251cc.tar.bz2 |
[Ada] Small adjustment to System.Val_Real
gcc/ada/
* libgnat/s-valrea.adb (Integer_to_Real): Always use Extra.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/libgnat/s-valrea.adb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/ada/libgnat/s-valrea.adb b/gcc/ada/libgnat/s-valrea.adb index 1add4e9..a4afc90 100644 --- a/gcc/ada/libgnat/s-valrea.adb +++ b/gcc/ada/libgnat/s-valrea.adb @@ -82,13 +82,12 @@ package body System.Val_Real is System.Float_Control.Reset; end if; - -- Take into account the extra digit near the limit to avoid anomalies + -- Take into account the extra digit - if Extra > 0 and then Val <= Precision_Limit / Uns (Base) then - R_Val := Num (Val * Uns (Base)) + Num (Extra); + R_Val := Num (Val); + if Extra > 0 then + R_Val := R_Val * Num (Base) + Num (Extra); S := S - 1; - else - R_Val := Num (Val); end if; -- Compute the final value |