uppressing division by zero errors
On Thu, 2002-01-31 at 15:16, Christopher William Wesley wrote:
> You really need to do some error checking on the denominator.
> $num = 5;
> $den = 0;
>
> echo $den != 0 ? $num/$den : "0";
>
> A number divided by zero isn't defined
On Thu, 2002-01-31 at 15:16, Christopher William Wesley wrote:
> You really need to do some error checking on the denominator.
> $num = 5;
> $den = 0;
>
> echo $den != 0 ? $num/$den : "0";
>
> A number divided by zero isn't defined, so you have to circumvent the
> situation by making sure it nev
[mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 01, 2002 10:17 AM
> To: [EMAIL PROTECTED]
> Cc: Martin Towell
> Subject: Re: [PHP] suppressing division by zero errors
>
>
> You really need to do some error checking on the denominator.
> $num = 5;
> $den = 0;
>
&
iam Wesley [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 10:17 AM
To: [EMAIL PROTECTED]
Cc: Martin Towell
Subject: Re: [PHP] suppressing division by zero errors
You really need to do some error checking on the denominator.
$num = 5;
$den = 0;
echo $den != 0 ? $num/$den : "0&quo
You really need to do some error checking on the denominator.
$num = 5;
$den = 0;
echo $den != 0 ? $num/$den : "0";
A number divided by zero isn't defined, so you have to circumvent the
situation by making sure it never happens.
~Chris /"\
On Thu, 2002-01-31 at 15:00, Martin Towell wrote:
> Is there a way to suppress division by zero errors?
>
> echo 5/0; // this give a warning - obviously!!
>
> @echo 5/0; // this gives a parse error
>
> echo @5/0; // this still comes up with a warning
>
> unless I turn error_reporting off be
Is there a way to suppress division by zero errors?
echo 5/0; // this give a warning - obviously!!
@echo 5/0; // this gives a parse error
echo @5/0; // this still comes up with a warning
unless I turn error_reporting off before and turn it back on afterwards, but
I don't want to do that unl
7 matches
Mail list logo