Top
Back: 5.1.103 quotient
Forward: 5.1.105 read
FastBack: 5. Functions and system variables
FastForward: 6. Tricks and pitfalls
Up: 5.1 Functions
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

5.1.104 random

Syntax:

random ( int_expression, int_expression )

Type:

int

Purpose:

returns a random integer between the integer given by the first int_expression and the one given by the second int_expression.

Syntax:

random ( int_expression, int_expression, int_expression )

Type:

intmat

Purpose:

returns a random intmat where the size is given by the second (number of rows) and third argument (number of columns). The absolute value of the entries of the matrix is smaller than or equal to the integer given as the first argument.

Note:

The random generator can be set to a start value with the function system, resp. by a command line option.

Example:
 
  random(1,1000);
→ 35
  random(1,2,3);
→ 0,0,0,
→ 1,1,-1 
  system("random",210);  // start random generator with 210
  random(-1000,1000);
→ 707
  random(-1000,1000);
→ 284
  system("random",210);
  random(-1000,1000);    // the same random values again
→ 707

See Command line options; int; intmat; system.


Top Back: 5.1.103 quotient Forward: 5.1.105 read FastBack: 5. Functions and system variables FastForward: 6. Tricks and pitfalls Up: 5.1 Functions Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.