Float -1 to 1 / number of bits

For general discussion related FlowStone
Post Reply
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Float -1 to 1 / number of bits

Post by chackl »

Hello!

How many bits does a green float and stream float have between -1 and 1?

Well if a float has 32bit from verry high to verry low - are 32 bit accurate enough for the falues -1 to 1???

Regards
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
support
Posts: 151
Joined: Fri Sep 07, 2012 2:10 pm

Re: Float -1 to 1 / number of bits

Post by support »

Yes the green Floats are 32 bit, you can see a full explanation here:

http://en.wikipedia.org/wiki/Single-precision_floating-point_format

If you need more precision Ruby uses double precision.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: Float -1 to 1 / number of bits

Post by MyCo »

From -1 to 1 there are 31 Bits in use, but when you also require flags like #IND,#INF,#NAN there are 32bits in use, too. As Explanation: if the second MSB is set, the float value is always above or equal abs(2)... so this bit is never used in -1 to 1 range. The resolution between 1 and -1 (including 1 and -1) is 1.073.741.825 steps... But in Float, there is also 0 and -0, so if you don't count that in, there is also one step less.
Post Reply