Re: Strange problem

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

Hello,

>All you need is:
>
>function int_round(object a)
>     return floor(a+0.5)
>end function
>
>This rounds off to the nearest integer.
>It works for atoms and sequences, negative numbers etc.

But I thought that floor() rounded "toward zero".
If so, then:
floor (-0.9 + 0.5) = 0
right? Or does it always round "down"?


>I mainly allowed non-integers because disallowing them
>would hurt performance slightly. Performance of subscripting is
>very important to most programs.

I agree there.

later,

Lewis Townsend
keroltarr at hotmail.com
http://geocities.com/keroltarr/

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu