Re: [PHP] How to test if a number is negative

2002-09-25 Thread Miles Thompson
Or, as my teenage son, who is smarter than me, suggests ... 1 / $x + abs( $x ) which yields 1/0 if $x is neg. (He didn't go into trapping for the error ... sigh.) Miles At 11:07 PM 9/25/2002 -0300, Miles Thompson wrote: >$x = -1; >if ($x < 0 ){ > echo "Negative"; >else >

Re: [PHP] How to test if a number is negative

2002-09-25 Thread Miles Thompson
$x = -1; if ($x < 0 ){ echo "Negative"; else echo "Positive"; } Or am I missing something? Miles At 07:02 PM 9/25/2002 -0700, Mike Dunlop wrote: >I've look through all the numerican functions but can't readily see a way >to test for a negative number e.g -7 > >Any ideas o