Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

baruch's scratchpad

by baruch (Beadle)
on Jun 01, 2004 at 17:23 UTC ( [id://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
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found