Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

baruch's scratchpad

by baruch (Beadle)
on Jun 01, 2004 at 17:23 UTC ( #358282=scratchpad: print w/replies, xml ) Need Help??

#!/bin/env perl -w use strict; use bigrat; my $ofile="../output/cfract.txt"; open (CF, "> $ofile") || die("Can't open $ofile: $!"); my $x; my$i; my @cf; my $cfindex; for($i=2;$i<=1000;$i++){ $cfindex=0; $x=sqrt($i/1); while (($x!=int($x)) && ($cfindex<20)) { $cf[$cfindex]=int($x); $x-=$cf[$cfindex]; $x=(1/$x); $cfindex++; } if($x!=int($x)){ print CF "\$i:$i\t\@cf= @cf\n";} } close(CF); print "Done\n";
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2020-11-29 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?