Forums > MaxMSP

mysterious round behavior

March 11, 2009 | 3:55 pm

Hi,

could someone explain to me why round behaves so weird for negative numbers ?

0.6 –> round = 1
1.4 –> round = 1
1.6 –> round = 2

-0.6 –> round = 0 ??
-1.4 –> round = 0 ??
-1.6 –> round = 0 ??

or am I missing something fundamental here ?


March 11, 2009 | 4:00 pm

not sure why but perhaps do a little conversion from positive to negative to get round the problem

EDIT – just tried it here and it works fine with negative values, though i’m running 5.0.5


March 11, 2009 | 4:08 pm

5.0.6 might be the culprit.

no worries, if known, I can take measures, it’s just that those kind of bugs are so fundamental and therefore so hard to spot.

see attachment…


March 11, 2009 | 5:07 pm
monohusche wrote on Wed, 11 March 2009 09:08
5.0.6 might be the culprit.

no worries, if known, I can take measures, it’s just that those kind of bugs are so fundamental and therefore so hard to spot.

see attachment…

I can’t reproduce. Are you sure you have the right round? There are many abstractions distributed with that name. What happens if you double-click it?

mz


March 11, 2009 | 5:13 pm

thx for the last comment which was on the the spot. that was indeed a different round from Karl-Heinz Essl

cheers, nick


March 11, 2009 | 11:22 pm

Thanks for confirming. Note that since 5.0.6 there’s a nearest attribute and round can also round to any number not just the closest integer.


March 12, 2009 | 7:12 am

Actually, I have to admit that I was slightly confused to not see the second inlet mentioned in the documentation when looking at my wrong "round".

But not clever enough to make the connection.

all good.


Viewing 7 posts - 1 through 7 (of 7 total)