|
|
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: 1892 (0x764)
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⟧
with Natural_Package; -- needs the Natural_Package.Log function
package body Base_Ten is
--======================================================
--= =
--= This package provides a function to return the log =
--= (to the base 10) of a number. The number must be a=
--= floating point number. This package currently does=
--= minimal error anlysis and numerical analysis to =
--= keep the correct accuracy and could, therefore use =
--= some improvement. =
--= =
--= =
--= written by Brad Balfour with help from Ed Berard =
--= version 1.0 =
--= June 16, 1985 =
--= =
--======================================================
package New_Natural is new Natural_Package (Argument => Argument,
Return_Value => Return_Value);
function Log (Of_Value : in Argument) return Return_Value is
-- written by Brad Balfour with help from Ed Berard
-- version 1.0
-- June 16, 1985
-- computes the log to the base 10 of the number Of_Value.
Natural_Log_Of_Ten : constant Return_Value := New_Natural.Log (10.0);
begin
-- Log
if Of_Value <= 0.0 then
raise Negative_Log;
else
-- ok to compute with argument > 0
return Return_Value (New_Natural.Log (Of_Value => Of_Value) /
Natural_Log_Of_Ten);
end if;
exception
when New_Natural.Value_Too_Large =>
raise Value_Too_Large;
end Log;
end Base_Ten;