

            prime (4) --- retrieve the 'i'th prime number            07/20/84


          | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 long_int function prime (i)
                 long_int i

          |      Library: vswtmath (Subsystem mathematical library)


            _F_u_n_c_t_i_o_n

                 'Prime'  is  used to retrieve a specified prime number.  The
                 argument is the ordinal of the prime  number  desired.   The
                 function return is the specified prime.  For example, if 'i'
                 is  1,  the  function return is 2; if 'i' is 3, the function
                 return is 5, etc.

                 'Prime'  uses  the  table  of  prime  numbers  in  the  file
                 "=aux=/primes".   This file contains the prime numbers up to
                 one   million   in   long-integer   binary    format.     If
                 "=aux=/primes"  is  unreadable or if 'i' is less than one or
                 greater than 78498, the function return is zero.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 The  file  "=aux=/primes"  is  opened  for   reading.    The
                 read/write pointer for the file is then moved to the desired
                 location  and  the  prime  number  read.   The  file is then
                 closed.


            _C_a_l_l_s

                 open, close, mapfd, Primos prwf$$


            _B_u_g_s

                 Should probably raise cain if the prime numbers file is  not
                 available, rather than meekly returning zero.

                 Locally supported.
















            prime (4)                     - 1 -                     prime (4)


