Int to fractional confusion (solved)


#1

Can anyone explain why this happens?
Or atleast how to get the same number.


#2

because the float has to represents floating point numbers, to do this its representation is different.
in particular they are shifted 21 bits to the left.
e.g 1 << 21 = 1, 1 << 20 = 0.5 , and 1 << 22 = 2

this is a good explanation of the format, the float would be Q21


#3

Awesome. Thank you.
That makes sense.


#4

I must admit, when working on custom objects, I tent to ignore the way numbers are represented in the UI, and just treat them as 27 bit signed/unsigned integers internally (i.e. in the object code).

a|x


Trying to understand the factory dist:soft object
#5

hooray it has totally solved my problem.

just add a math/>> 21and it reads as i want it to.