RandomTools Flavor: negative
describe a flavor of a random negative rational number
Calling Sequence
Parameters
Description
Examples
negative
negative(opts)
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
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.
with⁡RandomTools:
Generate⁡negative
−395718860535999999999989
Generate⁡negative⁡range=−5
−1775188193360999999999989
Generate⁡negative⁡range=−12,denominator=720720
−599120020
Generate⁡negative⁡denominator=10
−35
sort⁡seq⁡Generate⁡negative⁡denominator=6,character=closed,i=1..10,numeric
−1,−56,−56,−23,−23,−12,−12,−13,−13,−16
Generate⁡list⁡negative⁡range=−7,10
−3726557977362999999999989,−1425258752768999999999989,−5660154170121999999999989,−48658242459999999999989,−4415287476567999999999989,−895040021378999999999989,−5372569307909999999999989,−6966532724298999999999989,−1854803158024999999999989,−5313556435047999999999989
seq⁡Generate⁡negative⁡range=−7,denominator=720720,i=1..10
−86633120120,−379927102960,−6721960060,−3329219720720,−248903240240,−37521772072,−5193311440,−4932136036,−733963120120,−75671320
Matrix⁡3,3,Generate⁡negative⁡denominator=24⁢identical⁡x+negative⁡denominator=16,makeproc=true
−7⁢x8−34−19⁢x24−1516−x3−58−x8−116−17⁢x24−316−5⁢x24−516−5⁢x12−58−5⁢x12−1116−x12−12
See Also
convert/rational
flavor/structured
rand
RandomTools
RandomTools[Generate]
type/fraction
type/integer
type/negative
type/rational
Download Help Document