mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
parent
5e83be0dbf
commit
29fba8562c
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
#include <bio.h>
|
||||||
|
|
||||||
#define ptsiz (sizeof(pt)/sizeof(pt[0]))
|
#define ptsiz (sizeof(pt)/sizeof(pt[0]))
|
||||||
#define whsiz (sizeof(wheel)/sizeof(wheel[0]))
|
#define whsiz (sizeof(wheel)/sizeof(wheel[0]))
|
||||||
|
@ -32,6 +33,7 @@ uchar bittab[] =
|
||||||
|
|
||||||
void mark(double nn, long k);
|
void mark(double nn, long k);
|
||||||
void ouch(void);
|
void ouch(void);
|
||||||
|
Biobuf bout;
|
||||||
|
|
||||||
void
|
void
|
||||||
main(int argc, char *argp[])
|
main(int argc, char *argp[])
|
||||||
|
@ -39,6 +41,8 @@ main(int argc, char *argp[])
|
||||||
int i;
|
int i;
|
||||||
double k, temp, v, limit, nn;
|
double k, temp, v, limit, nn;
|
||||||
|
|
||||||
|
Binit(&bout, 1, OWRITE);
|
||||||
|
|
||||||
if(argc <= 1) {
|
if(argc <= 1) {
|
||||||
fprint(2, "usage: primes starting [ending]\n");
|
fprint(2, "usage: primes starting [ending]\n");
|
||||||
exits("usage");
|
exits("usage");
|
||||||
|
@ -101,7 +105,7 @@ main(int argc, char *argp[])
|
||||||
temp = nn + i;
|
temp = nn + i;
|
||||||
if(temp > limit)
|
if(temp > limit)
|
||||||
exits(0);
|
exits(0);
|
||||||
print("%.0f\n", temp);
|
Bprint(&bout, "%lld\n", (long long)temp);
|
||||||
if(limit >= big)
|
if(limit >= big)
|
||||||
exits(0);
|
exits(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue