Re: Warning: Division by zero

From: Date: Thu, 30 Apr 2009 13:21:20 +0000
Subject: Re: Warning: Division by zero
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-292154@lists.php.net to get a copy of this message
> The error I am getting is when I am defining a variable. > (line 15) $percent_difference=($assess_difference)/($assess_value); > Does this make a difference? No, it doesn't make a difference. The simple fact is that $assess_value is either undefined or has been set to 0 at some point. For it's use in the above equation, neither case is valid. Consequently, you really should be doing some validation at some point prior to that line. thnx, Christoph

« previous php.general (#292154) next »