when others => raise Program_Error);
-- Return the exponent of a power of 2
- function Integer_to_Real
+ function Integer_To_Real
(Str : String;
Val : Impl.Value_Array;
Base : Unsigned;
-- Return Num'Scaling (5.0**Exp, -S) as a double number where Exp > Maxexp
---------------------
- -- Integer_to_Real --
+ -- Integer_To_Real --
---------------------
- function Integer_to_Real
+ function Integer_To_Real
(Str : String;
Val : Impl.Value_Array;
Base : Unsigned;
-- Compute the final value by applying the scaling, if any
- if (Val (1) = 0 and then Val (2) = 0) or else S = 0 then
+ if Val (1) = 0 or else S = 0 then
R_Val := Double_Real.To_Single (D_Val);
else
exception
when Constraint_Error => Bad_Value (Str);
- end Integer_to_Real;
+ end Integer_To_Real;
-------------------
-- Large_Powfive --
begin
Val := Impl.Scan_Raw_Real (Str, Ptr, Max, Base, Scale, Extra, Minus);
- return Integer_to_Real (Str, Val, Base, Scale, Minus);
+ return Integer_To_Real (Str, Val, Base, Scale, Minus);
end Scan_Real;
----------------
begin
Val := Impl.Value_Raw_Real (Str, Base, Scale, Extra, Minus);
- return Integer_to_Real (Str, Val, Base, Scale, Minus);
+ return Integer_To_Real (Str, Val, Base, Scale, Minus);
end Value_Real;
end System.Val_Real;
--
-- Sum [Val (N) * (Base ** Scale (N)), N in 1 .. Parts]
--
- -- when Parts > 1, with the negative sign if Minus is true.
+ -- when Parts > 1, with the negative sign if Minus is true. Note that
+ -- Val (1) cannot be zero unless Val is entirely filled with zero.
--
-- If no valid real is found, then Ptr.all points either to an initial
-- non-blank character, or to Max + 1 if the field is all spaces and the