package owl-base

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file owl_base_stats_dist_uniform.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 1 "src/base/stats/owl_base_stats_dist_uniform.ml"
(*
 * OWL - an OCaml numerical library for scientific computing
 * Copyright (c) 2016-2018 Liang Wang <liang.wang@cl.cam.ac.uk>
 *)


(* return [0, n - 1] *)
let uniform_int_rvs n = Random.int n


let std_uniform_rvs () = Random.float 1.


let uniform_rvs ~a ~b =
  a +. (b -. a) *. (Random.float 1.)
OCaml

Innovation. Community. Security.