|
![](/i/fill.gif) |
Warp wrote:
> andrel <a_l### [at] hotmail com> wrote:
>> People have different expectation on what e.g.
>> floor() should do for negative numbers.
>
> AFAIK the floor() function is universally defined to round downwards,
> as the name implies. In other words, the return value is always smaller
> or equal to the parameter.
yes (except perhaps on very old equipment that had a sign bit and not
2s-complement), but that does not stop people from expecting that
floor(-x+.5)==-floor(x+.5) everywhere.
I was talking about expectations not definitions. (ok, 'would' in stead
of 'should' would (should?) have been better)
>
>> I agree that round() could be added as a function in POV4.
>
> Why? floor(value+.5) does the same thing.
>
no it doesn't, that was the whole point. In some cases people want a
function that round halves away from zero. round(-3.5)=-4
Post a reply to this message
|
![](/i/fill.gif) |