Re: simple eurphoria question

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ricardo M. Forno wrote:

[snipped]
> function f2(atom a)
>     if a < 0 then
> 	return - floor(- a)
>     end if
>     return floor(a)
> end function
[snipped]

Hi Ricardo,

Try please the below version:

function f2_(atom a)
     if a >= 0 then -- ">=" seems to be faster than just "<"
      return floor(a)
     end if
      return - floor(- a) -- it seems to be a rare case
 end function


Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu