|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3129 (0xc39)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
package body Average is
use Text_Io;
use Implementation_Dependencies;
use Type_Definitions;
procedure Averager (New_Average : out Integer;
Count : in Positive;
Current_Value : in Integer;
Previous_Value : in Integer) is
Temporary_Value : Float := 0.0;
begin
if Count > 1 then
Temporary_Value := (Float (Previous_Value) * Float (Count - 1)) +
Float (Current_Value);
New_Average := Integer (Temporary_Value / Float (Count));
elsif Count = 1 then
New_Average := Current_Value;
end if;
end Averager;
--
procedure Averager (New_Average : out Long_Integer;
Count : in Positive;
Current_Value : in Long_Integer;
Previous_Value : in Long_Integer) is
Temporary_Value : Float := 0.0;
begin
if Count > 1 then
Temporary_Value := (Float (Previous_Value) * Float (Count - 1)) +
Float (Current_Value);
New_Average := Long_Integer (Temporary_Value / Float (Count));
elsif Count = 1 then
New_Average := Current_Value;
end if;
end Averager;
procedure Averager (New_Average : out Float;
Count : in Positive;
Current_Value : in Float;
Previous_Value : in Float) is
Temporary_Value : Float := 0.0;
begin
if Count > 1 then
Temporary_Value :=
(Previous_Value * (Float (Count) - 1.0)) + Current_Value;
New_Average := Temporary_Value / Float (Count);
elsif Count = 1 then
New_Average := Current_Value;
end if;
end Averager;
-- procedure Averager (New_Average : out Long_Float;
-- Count : in Positive;
-- Current_Value : in Long_Float;
-- Previous_Value : in Long_Float) is
-- Temporary_Value : Long_Float := 0.0;
-- begin
-- if Count > 1 then
-- Temporary_Value := (Previous_Value * (Long_Float (Count) - 1.0)) +
-- Current_Value;
-- New_Average := Temporary_Value / Long_Float (Count);
-- elsif Count = 1 then
-- New_Average := Current_Value;
-- end if;
-- end Averager;
--procedure averager(new_average: out fixed_point;
-- count : in positive;
-- current_value : in fixed_point;
-- previous_value : in fixed_point) is
--
--temporary_value: fixed_point;
--begin
--if count > 1 then
--temporary_value:= previous_value * (fixed_point(count) - 1.0 );
--temporary_value:= temporary_value + current_value;
--new_average:= temporary_value / fixed_point(count);
--elsif count = 1 then
--new_average:= current_value;
--end if;
--end averager;
end Average;