Author Topic: effect is zero when no hits out  (Read 11432 times)

0 Members and 1 Guest are viewing this topic.

Offline N van Rooden

  • Newbie
  • *
  • Posts: 31
    • View Profile
effect is zero when no hits out
« on: June 08, 2011, 05:31:41 AM »
Hey,

I found a little bug on the effect value
effect is the value clicks devided by hits out.

deviding a number by zero should not be zero but unlimited high number, lets say a capped high value like 9999 ?
This trade who did send clicks but did not get anything back from ME should be ON TOP of the toplist sorted on effect.
But the error is when deviding by zero, it comes up with the effect value of zero....

When running toplists sorted on the effect value there must be at least one hit being sent out to get a trade in the toplist !!!
But when its sorted on effect the trade will never get in the toplist so the hit out will never be sent.
I can force that one hit, but when the trade dies it dies forever because the value effect will be zero again ! until I force again

Possible solution: Let the script think it always sent one hit to each trade (out value +1)

Hope this will get fixed because I want to run many new sites this way by only sending through thumb and textlinks sorted by effect.

Thanks

Offline Andrew

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: effect is zero when no hits out
« Reply #1 on: June 12, 2011, 05:22:48 PM »
I'll second this request.  And it's quite a common approach in both programming and in general maths to divide by 'n+1' instead of 'n'.

Offline Kildoozer

  • Administrator
  • Sr. Member
  • *****
  • Posts: 420
    • View Profile
Re: effect is zero when no hits out
« Reply #2 on: June 13, 2011, 10:53:39 PM »
Hi Andrew.
I've just change it. So now it looks like
Code: [Select]
$this->stats['effect'][$trader_info->domain]=($stats->Dout>0)?$stats->Dclick/$stats->Dout:$stats->Dclick;