home *** CD-ROM | disk | FTP | other *** search
- #-h- prime.r 915 local 01/05/81 21:33:07
- # prime --- get the ith prime number (from a file of primes)
-
- long_int function prime (i)
- long_int i
-
- integer fd, junk
- integer open, mapfd
-
- if (i < 1 || i > LASTPRIME)
- return (0)
-
- fd = open ("=aux=/primes"s, READ)
- if (fd == ERR)
- return (0)
-
- call prwf$$ (KREAD + KPREA, mapfd (fd), loc (prime), 2, (i-1)*2,
- junk, junk) # straight binary seek-and-read
- call close (fd)
-
- return
- end
- #-t- prime.r 915 local 01/05/81 21:33:07
- #-t- prime 2253 local 01/05/81 21:38:50
- ins the prime numbers up to one million in
- long-integer binary format.
- If =aux=/primes is unreadable or if '