comp.lang.ada
 help / color / mirror / Atom feed
From: cts@kampong.aedinc.net ((null))
Subject: Re: Discrete random
Date: Sun, 10 Sep 2000 19:19:05 GMT
Date: 2000-09-10T19:19:05+00:00	[thread overview]
Message-ID: <J8Ru5.245$kB1.448@newsfeed.slurp.net> (raw)
In-Reply-To: 39BBD440.6E19616@netcourrier.com

In article <39BBD440.6E19616@netcourrier.com>,
Mathias Dolidon  <matd@netcourrier.com> wrote:
>Look at this code :
>
>with ada.numerics;
>procedure ess is
>package pnh is new ada.numerics.discrete_random(positive);
>
>...
>
>At compile time, GNAT answers there's no 'discrete_random' package in
>'ada.numerics', but the reference manual specifies it. Where is the
>matter ?


Discrete_Random is a generic package.  You have to first instantiate
a package from the Discrete_Random Package with some discrete type.

For instance for an integer random number generator you would instantiate
something like-

   package Random_Integer is new Ada.Numerics.Discrete_Random (Integer);	

The ARM has a couple of good examples A.5.2.

-- 
=======================================================================
 Life is short.                  | Craig Spannring 
      Bike hard, ski fast.       | cts@internetcds.com
 --------------------------------+------------------------------------



  parent reply	other threads:[~2000-09-10 19:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-10 18:34 Discrete random Mathias Dolidon
2000-09-10 18:39 ` Laurent Guerby
2000-09-10 19:02   ` Mathias Dolidon
2000-09-11 18:23     ` Laurent Guerby
2000-09-10 18:41 ` Mathias Dolidon
2000-09-10 19:19 ` (null) [this message]
2000-09-11  4:07 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox