]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Small adjustment to System.Val_Real
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 26 Nov 2020 14:58:24 +0000 (15:58 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 15 Dec 2020 11:41:57 +0000 (06:41 -0500)
gcc/ada/

* libgnat/s-valrea.adb (Integer_to_Real): Always use Extra.

gcc/ada/libgnat/s-valrea.adb

index 1add4e9a6a9f9372cce1299bee698b0a68287ed2..a4afc90bb738a24d72c913191f7ca19d12ba049d 100644 (file)
@@ -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
This page took 0.06381 seconds and 5 git commands to generate.