--- ai12s/ai12-0144-1.txt 2016/03/18 01:44:34 1.10 +++ ai12s/ai12-0144-1.txt 2016/03/18 22:39:56 1.11 @@ -1,7 +1,9 @@ !standard A.5.2(20) 16-01-28 AI12-0144-1/07 !standard A.5.2(32) !standard A.5.2(41) +!standard A.5.2(42) !class Amendment 14-12-04 +!status Amendment 1-2012 16-02-29 !status ARG Approved 10-0-2 (By Letter Ballot) 16-02-26 !status work item 15-12-17 !status ARG Approved 7-0-0 15-10-18 @@ -52,7 +54,7 @@ function Random (Gen : Generator; First : Result_Subtype; Last : Result_Subtype) return Result_Subtype - with Post => Random'Result in First .. Last; + with Post =@> Random'Result in First .. Last; Modify A.5.2(32): @@ -78,7 +80,7 @@ function Random (Gen : Generator; First : Result_Subtype; Last : Result_Subtype) return Result_Subtype - with Post => Random'Result in First .. Last; + with Post =@> Random'Result in First .. Last; Obtains the "next" random number from the given generator, relative to its current state, according to an implementation-defined algorithm. If the @@ -170,6 +172,66 @@ Unfortunately, that is more incompatible, as renames and access-to-subprogram matching would fail (whereas the proposed solution is only incompatible if there are use-clause conflicts with the profile, which is unlikely). + +!corrigendum A.5.2(20) + +@dinsa +@xcode< @b<function> Random (Gen : Generator) @b<return> Result_Subtype;> +@dinst +@xcode< @b<function> Random (Gen : Generator; + First : Result_Subtype; + Last : Result_Subtype) @b<return> Result_Subtype + @b<with> Post => Random'Result in First .. Last;> + +!corrigendum A.5.2(32) + +@drepl +@xindent<Obtains the "next" random number from the given generator, relative +to its current state, according to an implementation-defined algorithm. The +result of the function in Numerics.Float_Random is delivered as a value of the +subtype Uniformly_Distributed, which is a subtype of the predefined type Float +having a range of 0.0 .. 1.0. The result of the function in an instantiation of +Numerics.Discrete_Random is delivered as a value of the generic formal subtype +Result_Subtype.> +@dby +@xindent<Obtains the "next" random number from the given generator, relative +to its current state, according to an implementation-defined algorithm.> + +@xcode< @b<function> Random (Gen : Generator; + First : Result_Subtype; + Last : Result_Subtype) @b<return> Result_Subtype + @b<with> Post => Random'Result in First .. Last;> + +@xindent<Obtains the "next" random number from the given generator, relative +to its current state, according to an implementation-defined algorithm. If the +range First .. Last is a null range, Constraint_Error is raised.> + +!corrigendum A.5.2(41) + +@drepl +A sufficiently long sequence of random numbers obtained by successive calls to +Random is approximately uniformly distributed over the range of the result +subtype. +@dby +Each call of a Random function has a @i<result range>; this is the range +First .. Last for the version of Random with First and Last parameters and +the range of the result subtype of the function otherwise. + +A sufficiently long sequence of random numbers obtained by consecutive +calls to Random that have the same generator and result range +is approximately uniformly distributed over the result range. + +!corrigendum A.5.2(42) + +@drepl +The Random function in an instantiation of Numerics.Discrete_Random is guaranteed +to yield each value in its result subtype in a finite number of calls, provided +that the number of such values does not exceed 2 15. +@dby +A Random function in an instantiation of Numerics.Discrete_Random is +guaranteed to yield each value in its result range in a +finite number of calls, provided that the number of such values does not +exceed 2 15. !ASIS

Questions? Ask the ACAA Technical Agent