Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

RE: RE: Primes

by japhy (Canon)
on Apr 09, 2000 at 00:14 UTC ( [id://7188]=note: print w/replies, xml ) Need Help??


in reply to RE: Primes
in thread Primes

Regular expressions can be made to solve diophantine equations! Please examine:
# for the equation: 3x + 2y + 10z = 50 ($x,$y,$z,$ans) = (3,2,10,50); $xpat = 0 x $x; $ypat = 0 x $y; $zpat = 0 x $z; if ((0 x $ans) =~ /^ ((?:$xpat)+) ((?:$ypat)+) ((?:$zpat)+) $/x) { print "x = ", length($1)/$x, "\n"; print "y = ", length($2)/$y, "\n"; print "z = ", length($3)/$z, "\n"; }
You can change this by making them * instead of +, or *? or +?. Isn't it sick?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://7188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-19 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found