Re: Rounding Was: Re: intersection and ExoticaX
- Posted by Jiri Babor <jbabor at PARADISE.NET.NZ> Jul 06, 2001
- 400 views
Yes, indeed, why not... Thanks, Carl. jiri ----- Original Message ----- From: <euphoria at carlw.legend.uk.com> To: "EUforum" <EUforum at topica.com> Subject: Rounding Was: Re: intersection and ExoticaX > > > Jiri wrote: > > > function round(object x) -- recursive > > if atom(x) then > > return floor(x+0.5) > > end if > > for i=1 to length(x) do > > x[i] = round(x[i]) > > end for > > return x > > end function > > Okay, I'll bite. > > Why not just: > > function round(object x) > return floor(x+.5) > end function > > ...? floor() is usable on sequences after all, as is adding 0.5. > > It's faster by 30ish% too. > > Or am I asking for trouble posting this sort of thing again. > > Cowering in the corner, > Carl > > -- > Carl R White - aka - Cyrek > eMail: carlw at legend.co.uk > cyrek at bigfoot.com > URL: nope none nada zip > > > > > >