mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-01 13:11:11 +00:00
Update random.d.er
This commit is contained in:
parent
6ad4e0d964
commit
24627eb26c
4 changed files with 41 additions and 4 deletions
|
@ -1,3 +1,14 @@
|
|||
.seed!: (a := Num, version := Int) => NoneType
|
||||
.randbytes!: (n: Nat) => Bytes
|
||||
.randrange!: (start: Int, stop := Int, step := Int) => Int
|
||||
.randint!: (a: Int, b: Int) => Int
|
||||
.getrandbits!: (k: Nat) => Nat
|
||||
.choice!: |T: Type, S <: Seq(T)|(seq: S) => T
|
||||
# TODO: dependent length array type
|
||||
.choices!: |T: Type, S <: Seq(T)|(population: S, weights := [Nat; _] or NoneType, k := Nat) => [T; _]
|
||||
# TODO: Seq!
|
||||
.shuffle!: |T: Type, S <: Seq(T)|(seq: S) => NoneType
|
||||
.sample!: |T: Type, S <: Seq(T)|(population: S, k := Nat) => [T; _]
|
||||
.random!: () => 0.0..1.0 # TODO: <1.0
|
||||
.dep_uniform! = 'uniform': |A: Int, B: Int|(a: {A}, b: {B}) => A..B
|
||||
.uniform!: (a: Int, b: Int) => Int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue