🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.os2
Article #11

������, Pentium MMX 200 ���� >> RS6000 59H

#11
From: л��ͥ
Date: Wed, 26 Nov 1997 00:00
103 lines
4028 bytes

����Ķ�����һ�����Ǻõ�, ������һС�������һ��, 
��Ҫ�����Ǽ�������(���Ǵ�ѧһ�꼶��Ҫ�ı�̼���)
������, û�б��.

�ȽϽ������:

                Pentium MMX 200           RS/6000 59H

CPU             MMX 200                   RISC ??? (sorry, 59h��CPU?)

�ڴ�            64M                       256M

����ϵͳ        Linux kernel 2.0.30       AIX 4.1 (��õ���jfs, sigh, 
                                             linuxҲ�оͺ���)

������UID       root                      root

����ʱϵͳ����  0.00, 0.00, 0.00          0.00, 0.00, 0.00

���������      2.7.2.2 for Linux         2.7.2.2 for AIX

�����ҵij���
  ���:

1�����������
  ����:         506291                     275754

��ɵ����һ��
   ������:      7468759                    3887311

������:       Pentium MMX����ܲ�����? �������ҵij���ֻ������
                ����, ������������������, ����������������
                ��, rs/6000����ǰ�� �������ڿ��ѱ�����ۿ�, 
                ����, �ó�����ЩƬ��, �������ʹ��aix��ccֱ�ӱ���
                �Ļ�, ����������һ�����, ����ȫ���ܹ��ﵽ�����
                MMX�ٶ�.

                ��֪��λ�кθ߼�? �Լ�������ij������һ�����Կ�.

�������嵥: (prime3.c)
���³�����tc, gcc, wcl386(watcom c), cc(Sun&AIX&Ultra&Alpha)����ͨ��.
gcc -o prime3 prime3.c

---------------- start here ----------------


#include <stdio.h>
#include <time.h>

#define max 8952     /* enough to count all long primes, do not change it */
#define duration 60   /* in seconds, 0 for no time-controlling */
#define report_rate 100  /* report every 100 primes, 0 for none */

main()
{
  long prime[max];
  long divident, gate, threshold, biggest, count;
  int index, step;
  time_t time_begin, dumb;

  time_begin=time(&dumb);
  prime[0]=2L; count=1L;  /* first prime */
  threshold=0L; gate=9L; step=report_rate-1;
  if (report_rate==0) printf("Calculating, do not disturb ... ");
  for (divident=3L; divident<0x7fffffffL; divident+=2L)
  {
    if (divident==gate)
    {
      threshold++;
      gate=prime[threshold+1]*prime[threshold+1];
      continue;
    }
    index=1;
    while (index<=threshold && divident%prime[index]!=0) index++;
    if (index>threshold)  /* a prime found */
    {
      biggest=divident;
      if (count<max) prime[count]=divident;
      count++;
      if (report_rate!=0)
      {
        step--;
        if (step<=0)
        {
          printf("%ld: %ld\n", count, divident);
          step=report_rate;
        }
      }
      if (duration!=0)
        if (time(&dumb)-time_begin>=duration)
          break;
    }
  }
  printf("%ld primes generated, the biggest is %ld, %ld seconds used.\n",
         count, biggest, time(&dumb)-time_begin);
}

-------------- end here. ---------------------

--
�� ��Դ:���������� cs3.xmu.edu.cn��[FROM: cs3.xmu.edu.cn]
Technical Details
Message-ID: <3LgKlP$0qx@cs3.xmu.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 118e73,ecfa82fb72ce8372,start
X-Google-Attributes: gid118e73,public
From: tin.bbs@cs3.xmu.edu.cn (л��ͥ)
Subject: ������, Pentium MMX 200 ���� >> RS6000 59H
Date: 1997/11/26
Message-ID: <3LgKlP$0qx@cs3.xmu.edu.cn>
X-Deja-AN: 293208967
X-Filename: os2/M.880581865.A
Organization: XMU CS BBS
Newsgroups: cn.bbs.comp.os2