Forums > MaxMSP

jit.op bug: 12 multiplied by 10 outputs 0

May 28, 2010 | 1:10 pm

i think i found a jit.op bug
12 * 10 = 0;
12 * 10. = 11;

– Pasted Max Patch, click to expand. –

May 28, 2010 | 4:19 pm

You should do this with float32 matrix

– Pasted Max Patch, click to expand. –

May 31, 2010 | 9:06 am

hm, i had a similar problem like this:

http://cycling74.com/forums/topic.php?id=15774

solution was to switch to a long matrix. but nevertheless i do not understand why jit.op is so buggy with char matrices.

and: i do not understand why nobody from cycling comments on such a blatant bug.

and: this was with max 4, in max 5 this bug is still existing!

somehow i get a feeling that this forum has changed?

micha


May 31, 2010 | 4:18 pm

thanks kyred and micha for the quick reply
converting each matrix from char to float32 is for sure a very performative workaround ;-)

actually i am trying to apply jit.op * to a char matrix in java
now i converted it with mymatrix.setType("float32")

and i still cant multiply my by 10. !!!!!!!!!!!! ;-(

well. never mind. multiplications are probably not so important for programming


June 1, 2010 | 9:30 am

yeah, they are not so important and way overrated. additionally you can fake them using additions.

i still don’t understand why nobody from cycling comments on this? there were times, when communication to the company (esp. joshua, ben and topher) was really easy and quick via the mailinglist.


June 2, 2010 | 8:11 pm

After a conversation with JKC regarding this whole deal and the float value 10., I think I understand what is going on here.

Culling from our conversation, float 10. is actually 1., as char data is mapped to 0-1. However, 1. (char 255) is not really 1. (which isn’t representable in 8 bit fixed point, since it would be 256). So floating point greater than 1. becomes 1.-1/256., i.e. 0.996.

This all boils down to a more simple explanation that float maps to the range 0-0.996 char 0-255.

-Ben


June 2, 2010 | 8:12 pm

Also, there is no modulo arithmetic going on as it says in the jit.op ref regarding char data. I’ll make sure that our documentation is updated.

-Ben


June 7, 2010 | 10:36 am

ben, thanks for the detailed explanation, these are the kind of answers and interna i want to hear ;-). only question open is why jit.expr works correctly, while jit.op does not?


June 7, 2010 | 7:52 pm

jit.expr is always float32 processing.


June 9, 2010 | 1:31 am

thanks for the explanations


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