ciao icon indicating copy to clipboard operation
ciao copied to clipboard

Feature request random/3 that works with bigint

Open Jean-Luc-Picard-2021 opened this issue 2 years ago • 0 comments

I guess random/3 always generates zero, for a large M:

/* Ciao 1.22.0 */
?- M is (1<<101), random(0,M,X).
X = 0

?- M is (1<<101), random(0,M,X).
X = 0

Doesn’t happen for a smallint argument:

?- random(0,77,X).
X = 62

?- random(0,77,X).
X = 71

What about a random/3 that could deal with bigints, like random_between/3 from SWI-Prolog?

Jean-Luc-Picard-2021 avatar Oct 13 '22 15:10 Jean-Luc-Picard-2021