[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: [hackers] Re: x86-64 support
From:       Jason Andresen <jandrese () mitre ! org>
Date:       2003-04-30 14:25:46
[Download RAW message or body]

Terry Lambert wrote:
> Harti Brandt wrote:
> DG>501859265358979323846264338327950288419716939937510582097494459230781640628620899 \
> 862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316
>  
> > DG>
> > DG>... and so on for many digits.  Neither matches:
> > DG>
> > DG>echo "scale=200; 4*a(1)" | bc -l
> > DG>3.141592653589793238462643383279502884197169399375105820974944592307\
> > DG>81640628620899862803482534211706798214808651328230664709384460955058\
> > DG>223172535940812848111745028410270193852110555964462294895493038196
> > 
> > If you look careful only the first four digits don't match.
> 
> 
> You mean the four most significant digits, right?  8-) 8-) 8-).

Strange though, it worked for me (although I did clean up the code a 
touch to see exactly what it did before I ran it):

#include <stdio.h>

int main()
{
         int f[91800],b,c=9814,g,i;
         long a=1e4,d,e,h;
         for(;b=c,c-=14;i=printf("%04d",e+d/a),e=d%a)
                 while(g=--b*2)
                         d=h*b+a*(i?f[b]:a/5),h=d/--g,f[b]=d%g;
}

% ./pi
31415926535897932384626433832795028841971693993751058209749445923078164062862089986280 \
34825342117067982148086513282306647093844609550582231725359408128481117450284102701938 \
52110555964462294895493038196442881097566593344612847564823378678316527120190914564856 \
69234603486104543266482133936072602491412737245870066063155881748815209209628292540917 \
15364367892590360011330530548820466521384146951941511609433057270365759591953092186117 \
38193261179310511854807446237996274956735188575272489122793818301194912983367336244065 \
66430860213949463952247371907021798609437027705392171762931767523846748184676694051320 \
00568127145263560827785771342757789609173637178721468440901224953430146549585371050792 \
27968925892354201995611212902196086403441815981362977477130996051870721134999999837297 \
80499510597317328160963185950244594553469083026425223082533446850352619311881710100031 \
378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959
 0921642019893809525720106548586327886593615338182796823030195203530185296899577362259 \
94138912497217752834791315155748572424541506959508295331168617278558890750983817546374 \
64939319255060400927701671139009848824012858361603563707660104710181942955596198946767 \
83744944825537977472684710404753464620804668425906949129331367702898915210475216205696 \
60240580381501935112533824300355876402474964732639141992726042699227967823547816360093 \
41721641219924586315030286182974555706749838505494588586926995690927210797509302955321 \
16534498720275596023648066549911988183479775356636980742654252786255181841757467289097 \
77727938000816470600161452491921732172147723501414419735685481613611573525521334757418 \
49468438523323907394143334547762416862518983569485562099219222184272550254256887671790 \
49460165346680498862723279178608578438382796797668145410095388378636095068006422512520 \
51173929848960841284886269456042419652850222106611863067442786220391949450471237137869609563643719172874677646575739624138908658326
 4599581339047802759009946576407895126946839835259570982582262052248940772671947826848 \
26014769909026401363944374553050682034962524517493996514314298091906592509372216964615 \
15709858387410597885959772975498930161753928468138268683868942774155991855925245953959 \
43104997252468084598727364469584865383673622262609912460805124388439045124413654976278 \
07977156914359977001296160894416948685558484063534220722258284886481584560285060168427 \
39452267467678895252138522549954666727823986456596116354886230577456498035593634568174 \
32411251507606947945109659609402522887971089314566913686722874894056010150330861792868 \
09208747609178249385890097149096759852613655497818931297848216829989487226588048575640142704775551323796414515237462343645428584447952658678


I made f bigger than I needed to, but it was only on a hunch with the 
original code (which dumped core).

-- 
   \  |_ _|__ __|_ \ __| Jason Andresen        jandrese@mitre.org
  |\/ |  |    |    / _|  Network and Distributed Systems Engineer
_|  _|___|  _| _|_\___| Office: 703-883-7755


_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic