Your technology certification is waiting. Enroll in Cloud Class ®
function TForm1.RandEven: Integer;
Result := (Random( 64000 ) + 1000);
UNtil (Result Mod 2) = 0
Open in new window
function randomeven(min, max: double): double;
var range, tmp : double;
if min > max then
tmp := min;
min := max;
max := tmp;
min := min / 2;
max := max / 2;
range := max - min;
randomeven := (min + Random * range) * 2;
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.