Re: simple eurphoria question
- Posted by Chris Bensler <bensler at nt.net> Dec 09, 2006
- 709 views
Ricardo M. Forno wrote: > Yep, you are right. > I performed the following test of candidate good functions for this task. > The results showed all three were correct, but f2 was the fastest: Did you try changing the order of the code in your bench tests, to verify that it wasn't affecting your results? I've found it to be a major factor in any kind of trivial timing test. Also, it should be slightly faster if the last return statement in f2() was inside of an if-branch.. As Matt (I beleive) pointed out with his winning code from the christmas contest a few years ago.
function f2(atom a) if a < 0 then return - floor(- a) else return floor(a) end if end function
Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria