diff --git a/src/core/CCRandom.ml b/src/core/CCRandom.ml index b4d75504..12d970e1 100644 --- a/src/core/CCRandom.ml +++ b/src/core/CCRandom.ml @@ -70,8 +70,7 @@ let float f st = Random.State.float st f let small_float = float 100.0 -let float_range i j st = i +. Random.State.float st (j-.i+.1.) - +let float_range i j st = i +. Random.State.float st (j-.i) let replicate n g st = let rec aux acc n = diff --git a/src/core/CCRandom.mli b/src/core/CCRandom.mli index 506fca86..05b05c8c 100644 --- a/src/core/CCRandom.mli +++ b/src/core/CCRandom.mli @@ -97,10 +97,9 @@ val float : float -> float t @since 0.6.1 *) val float_range : float -> float -> float t -(** Inclusive range +(** Inclusive range. [float_range a b] assumes [a < b]. @since 0.6.1 *) - val split : int -> (int * int) option t (** Split a positive value [n] into [n1,n2] where [n = n1 + n2]. @return [None] if the value is too small *)