2020-06-05 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnat/a-nudira.ads, libgnat/a-nudira.adb (Random): New
function.
return Random (SRN.Generator (Gen));
end Random;
+ function Random
+ (Gen : Generator;
+ First : Result_Subtype;
+ Last : Result_Subtype) return Result_Subtype
+ is
+ subtype Local_Subtype is Result_Subtype range First .. Last;
+ function Random is new SRN.Random_Discrete (Local_Subtype, First);
+ begin
+ return Random (SRN.Generator (Gen));
+ end Random;
+
-----------
-- Reset --
-----------
function Random (Gen : Generator) return Result_Subtype;
+ function Random
+ (Gen : Generator;
+ First : Result_Subtype;
+ Last : Result_Subtype) return Result_Subtype
+ with Post => Random'Result in First .. Last;
+
procedure Reset (Gen : Generator; Initiator : Integer);
procedure Reset (Gen : Generator);