RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Martin Towell
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

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
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

RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
[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; > &

RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Martin Towell
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

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Christopher William Wesley
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 /"\

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
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