jit.op bug: 12 multiplied by 10 outputs 0

May 28, 2010 at 1:10pm

jit.op bug: 12 multiplied by 10 outputs 0

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

– Pasted Max Patch, click to expand. –
#50624
May 28, 2010 at 4:19pm

You should do this with float32 matrix

– Pasted Max Patch, click to expand. –
#181611
May 31, 2010 at 9:06am

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

#181612
May 31, 2010 at 4:18pm

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

#181613
Jun 1, 2010 at 9:30am

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.

#181614
Jun 2, 2010 at 8:11pm

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

#181616
Jun 2, 2010 at 8:12pm

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

#181617
Jun 7, 2010 at 10:36am

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?

#181618
Jun 7, 2010 at 7:52pm

jit.expr is always float32 processing.

#181619
Jun 9, 2010 at 1:31am

thanks for the explanations

#181620

You must be logged in to reply to this topic.