1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need a small coding help

Discussion in 'Programming' started by prep, Aug 24, 2009.

  1. #1
    hello everyone!!!

    right now i am stuck in a logic of finding prime numbers using "recursion" functions..can anyone please help me out ...
    SEMrush
    thanks
     
    prep, Aug 24, 2009 IP
    crivion likes this.
    SEMrush
  2. crivion

    crivion Well-Known Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    160
    Digital Goods:
    3
    As Seller:
    100% - 3
    As Buyer:
    100% - 0
    #2
    function is_prime_number($i)
    {
    if($i % 2 != 1) return false;
    $d = 3;
    $x = sqrt($i);
    while ($i % $d != 0 && $d < $x) $d += 2;
    return (($i % $d == 0 && $i != $d) * 1) == 0 ? true : false;
    }
     
    crivion, Aug 24, 2009 IP
    prep likes this.
  3. webgig

    webgig Peon

    Messages:
    126
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    How much for that?
     
    webgig, Aug 26, 2009 IP