1. Rounding Was: Re: intersection and ExoticaX
- Posted by euphoria at carlw.legend.uk.com Jul 06, 2001
- 412 views
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
2. Re: Rounding Was: Re: intersection and ExoticaX
- Posted by Jiri Babor <jbabor at PARADISE.NET.NZ> Jul 06, 2001
- 399 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 > > > > > >
3. Re: Rounding Was: Re: intersection and ExoticaX
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Jul 06, 2001
- 392 views
Hello, Thanks Jiri and Carl. I'll look at this solution. Has anyone compared this to Jeff's speedwise? I can do it. Just wondering. thanks again, Lewis Townsend >