negative - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


RandomTools Flavor: negative

describe a flavor of a random negative rational number

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

negative

negative(opts)

Parameters

opts

-

equation(s) of the form option = value where option is one of range, character, or denominator; specify options for the random negative rational number

Description

• 

The flavor negative describes a random negative rational number in a particular range.

  

To describe a flavor of a random negative rational number, use either negative or negative(opts) (where opts is described following) as the argument to RandomTools[Generate] or as part of a structured flavor.

• 

By default, the flavor negative describes a random rational number in the range −1..0 (excluding 0) with a denominator of 999999999989, or the integer −1.

• 

You can modify the properties of a random rational number by using the rational(opts) form of this flavor. The opts argument can contain one or more of the following equations.

  

 

  

range = a

  

This option describes the left endpoint of the range from which the random rational number is chosen. The left endpoint must be of type rational and negative and it describes a random rational number in the interval a..0, where 0 is excluded and inclusiveness of a is determined by the character option.

  

 

  

character = open or closed

  

This option specifies whether to include the left endpoint of the range from which the random rational number is chosen. The default value for this option is closed.

  

 

  

denominator = posint

  

This option specifies the negative integer to use as the denominator for the random rational number that is generated. Note: The return value may be an integer, or a fraction with a denominator that is a factor of the specified integer.

  

The default denominator is 999999999989.

  

In the case of the closed interval −1..0, the denominator is prime. Therefore, a result of 13 cannot occur. Instead, you can specify a denominator that is highly composite. For example, 720720.

Examples

withRandomTools:

Generatenegative

395718860535999999999989

(1)

Generatenegativerange=5

1775188193360999999999989

(2)

Generatenegativerange=12,denominator=720720

599120020

(3)

Generatenegativedenominator=10

35

(4)

sortseqGeneratenegativedenominator=6,character=closed,i=1..10,numeric

−1,56,56,23,23,12,12,13,13,16

(5)

Generatelistnegativerange=7,10

3726557977362999999999989,1425258752768999999999989,5660154170121999999999989,48658242459999999999989,4415287476567999999999989,895040021378999999999989,5372569307909999999999989,6966532724298999999999989,1854803158024999999999989,5313556435047999999999989

(6)

seqGeneratenegativerange=7,denominator=720720,i=1..10

86633120120,379927102960,6721960060,3329219720720,248903240240,37521772072,5193311440,4932136036,733963120120,75671320

(7)

Matrix3,3,Generatenegativedenominator=24identicalx+negativedenominator=16,makeproc=true

7x83419x241516x358x811617x243165x245165x12585x121116x1212

(8)

See Also

convert/rational

flavor/structured

rand

RandomTools

RandomTools[Generate]

type/fraction

type/integer

type/negative

type/rational