Script Pulse

Trade Pulse => Trade Pulse Bug Reports => Topic started by: N van Rooden on June 08, 2011, 05:31:41 AM

Title: effect is zero when no hits out
Post by: N van Rooden 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
Title: Re: effect is zero when no hits out
Post by: Andrew 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'.
Title: Re: effect is zero when no hits out
Post by: Kildoozer 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;