Close
Close window
integer - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

RandomTools Flavor: integer

describe a flavor of a random integer

Calling Sequence

integer

integer(opt)

Parameters

opt

-

equation of the form range = value; specify options for the random integer

Description

The flavor integer describes a random integer in a particular range.

To describe a flavor of a random integer, use either integer or integer(opt) (where opt is as described below) as the argument to RandomTools[Generate] or as part of a structured flavor .

By default, the flavor integer describes a random integer in the range −499999999994..499999999994, inclusive.

You can modify the properties of the random integer by using the integer(opt) form of this flavor. The opt argument can contain one or more of the following equations.

range = a..b

This option specifies the range from which the random integer is chosen.

The endpoints must be of type integer and they describe a random integer in the interval a..b, inclusive.

If the left-hand endpoint of the range is greater than the right-hand endpoint, an exception is raised.

exclude= {n1,n2,...}

This option specifies one or more individual integers that should be excluded from the possible return values.

Examples

>

withRandomTools:

>

Generateinteger

−104281139460

(1)
>

Generateintegerrange=2..7

3

(2)
>

seqGenerateinteger,i=1..10

−306860183579,−477575829529,300187484465,−72447943125,342622684448,−87713714154,496417214186,−113591692544,194607189271,273012980029

(3)
>

Generatelistintegerrange=5..5,10

5,−3,3,4,−4,5,2,4,3,5

(4)
>

Matrix3,3,Generateintegerrange=2..7identicalx+integerrange=2..7,makeproc=true

2x+76x+75x+47x+64x+65x+43x+42x+24x+6

(5)
>

Generateintegerrange=10..10,exclude=0,1,1

−6

(6)
>

seqGenerateintegerrange=5..5,exclude=0,1,1,i=1..20

4,4,4,5,−4,2,−2,−4,3,3,−2,−3,4,3,4,5,−2,3,2,3

(7)


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /