home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
ADA
/
GNAT200
/
ADAINC
/
A-NUFLRA.ADS
< prev
next >
Wrap
Text File
|
1994-11-30
|
2KB
|
60 lines
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . N U M E R I C S . F L O A T _ R A N D O M --
-- --
-- S p e c --
-- --
-- $Revision: 1.7 $ --
-- --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Numerics.Random;
with Ada.Finalization;
package Ada.Numerics.Float_Random is
-- Basic facilities
type Generator is limited private;
subtype Uniformly_Distributed is Float range 0.0 .. 1.0;
function Random (Gen : Generator) return Uniformly_Distributed;
procedure Reset (Gen : in Generator; Initiator : in Integer);
procedure Reset (Gen : in Generator);
-- Advanced facilities
type State is private;
procedure Save (Gen : in Generator; To_State : out State);
procedure Reset (Gen : in Generator; From_State : in State);
Max_Image_Width : constant := Ada.Numerics.Random.Max_Image_Width;
function Image (Of_State : State) return String;
function Value (Coded_State : String) return State;
private
package ANR renames Ada.Numerics.Random;
type State is new ANR.State;
type Access_State is access ANR.State;
type Generator is
new Ada.Finalization.Limited_Controlled with record
State : Access_State := new ANR.State'(ANR.Make_State);
end record;
procedure Finalize (Gen : in out Generator);
end Ada.Numerics.Float_Random;