Appendix A: System Routines — Math
815
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_rand
Declaration:
void 
push_rand
 (EStackIndex 
num_idx
)
Category(ies):
Math
Description:
Pushes a random number onto the estack. If 
num_idx
 indexes the
END_TAG then a floating-point number between zero and one is
generated. If the number indexed by 
num_idx
 is a positive integer then a
number between one and that number is generated. If the number indexed
by 
num_idx
 is a negative integer then a number between that integer and
minus one is generated.
Inputs:
num_idx
— Indexes the input number (may index an END_TAG).
Outputs:
None
Assumptions:
None
Side Effects:
May expand expression stack, cause heap compression, or throw an error.
Availability:
On AMS 1.05 and higher.
TI-89 / TI-92 Plus
Differences:
None
See Also: push_randmat, push_randpoly, push_randnorm
Example:
This example pushes a list of ten random numbers in the range [0.0, 1.0]
on the estack.
EStackIndex esi;
short i;
push_quantum( END_TAG );
esi = top_estack;
for (i = 1; i <= 10; i++)
   push_rand( esi );  /* index END_TAG (so get numbers in range 0 . . . 1) */
push_quantum( LIST_TAG );