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

RandomTools Flavor: negint

describe a flavor of a random negative integer

 Calling Sequence negint negint(opt)

Parameters

 opt - equation of the form range = value; specify option for the random negative integer

Description

 • The flavor negint describes a random negative integer in a particular range.
 To describe a flavor of a random negative integer, use either negint or negint(opt) (where opt is described following) as the argument to RandomTools[Generate] or as part of a structured flavor.
 • By default, the flavor negint describes a random negative integer in the range $-99999999989..-1$, inclusive.
 • You can modify the properties a negative random integer by using the negint(opt) form of this flavor.  The opt argument can contain the following equation.
 range = a
 This option describes the left endpoint of the range from which the random integer is chosen.
 The left endpoint must be of type negint and it describes a random integer in the interval $a..-1$, inclusive.

Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{Generate}\left(\mathrm{negint}\right)$
 ${-36284123260}$ (1)
 > $\mathrm{Generate}\left(\mathrm{negint}\left(\mathrm{range}=-7\right)\right)$
 ${-3}$ (2)
 > $\mathrm{seq}\left(\mathrm{Generate}\left(\mathrm{negint}\right),i=1..10\right)$
 ${-92989070395}{,}{-52336426898}{,}{-77329022769}{,}{-27168062734}{,}{-78675966108}{,}{-22816891714}{,}{-20605916125}{,}{-42353974212}{,}{-66532724364}{,}{-40044436554}$ (3)
 > $\mathrm{Generate}\left(\mathrm{list}\left(\mathrm{negint}\left(\mathrm{range}=-5\right),10\right)\right)$
 $\left[{-5}{,}{-1}{,}{-3}{,}{-5}{,}{-1}{,}{-2}{,}{-3}{,}{-1}{,}{-3}{,}{-1}\right]$ (4)
 > $\mathrm{Matrix}\left(3,3,\mathrm{Generate}\left(\mathrm{negint}\left(\mathrm{range}=-7\right)\mathrm{identical}\left(x\right)+\mathrm{negint}\left(\mathrm{range}=-7\right),\mathrm{makeproc}=\mathrm{true}\right)\right)$
 $\left[\begin{array}{ccc}{-}{4}{}{x}{-}{5}& {-}{x}{-}{6}& {-}{5}{}{x}{-}{7}\\ {-}{7}{}{x}{-}{5}& {-}{3}{}{x}{-}{3}& {-}{6}{}{x}{-}{6}\\ {-}{6}{}{x}{-}{5}& {-}{6}{}{x}{-}{4}& {-}{x}{-}{6}\end{array}\right]$ (5)