On Tuesday 28 December 2004 01:13, Ford, Mike wrote:
> > abs():
> >
> > $doo = -20;
> > for ($i = 1; $i < 1000; $i++) {
> > $dah = abs($doo);
> > }
>
> That's not a valid benchmark, since only on the first pass through the loop
> is $doo negative.
I'm not sure what you m
* Thus wrote Ford, Mike:
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>
>
>
> > -Original Message-
> > From: Jason Wong
> > Sent: 27/12/04 10:16
> >
> > On Monday 27 December 2004 12:40, Richard Lynch wrote:
> >
>
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
> -Original Message-
> From: Jason Wong
> Sent: 27/12/04 10:16
>
> On Monday 27 December 2004 12:40, Richard Lynch wrote:
>
> > If you want to mimic the behaviour of abs (a
On Mon, 27 Dec 2004 18:16:21 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:
> ternary:
>
>$doo = -20;
>for ($i = 1; $i < 1000; $i++) {
>$dah = ($doo < 0) ? - $doo : $doo;
>}
>
> abs():
>
>$doo = -20;
>for ($i = 1; $i < 1000; $i++) {
>$dah = abs($doo);
>
On Monday 27 December 2004 12:40, Richard Lynch wrote:
> If you want to mimic the behaviour of abs (allowing for positive numbers)
> and performance was an issue, that:
> $x = ($x < 0) ? - $x : $x;
>
> is most likely faster than abs()
Having nothing better to do I decided to benchmark this:
tern
5 matches
Mail list logo