<number> = Numeric functions: randomrandom <number>
<number> = Numeric functions: randomrandom ( <number> )
Create a Numeric functions: randomrandom Glossary: number, num_valnumber in range [0 .. [n.
Flow control: if … then Flow control: try … thenThe Numeric functions: randomrandom Glossary: number, num_valnumber is a fractional Glossary: number, num_valnumber in Flow control: if … then Flow control: try … thenthe desired range. Flow control: if … thenIf you need integers Flow control: if … then Flow control: try … thenthen you can apply Vipsi command syntax: Functions Functions Glossary: Functionfunction Numeric functions: intint afterwards.
Flow control: if … then Flow control: try … thenThe Numeric functions: randomrandom Glossary: number, num_valnumber generator is seeded on program start.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which accept exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis are optional Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and may be omitted Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument is no Vipsi command syntax: Expressions Glossary: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
vipsi> Numeric functions: randomrandom 5 = 1.5446008834988
vipsi> Numeric functions: randomrandom 5 = 3.4346934012137
vipsi> Numeric functions: randomrandom 5 = 3.8431410165504
vipsi> Numeric functions: randomrandom 5 = 4.5170289813541
vipsi> Instructions: procproc W6() { Flow control: returnreturn 1+Numeric functions: intint(Numeric functions: randomrandom 6) }
vipsi> W6() 3
vipsi> W6() 4
vipsi> W6() 1
vipsi>
|