The negative exponent bothers me. Every implementation I've used specifies either mantissa bits or exponent bits, as a positive value. The extraneous '-' everywhere feels like a waste
The fixed_point C++ Class Template
21–23 of 23 posts
Re: The fixed_point C++ Class Template
#22I was having trouble understanding why fixed-point arithmetic was particularly useful in game development. In fact, I was curious why fixed point representation was more useful than floating point at all... Two links deep, I found [1]. The salient being "...floating point representation gives you extra precision for numbers near zero, this extra precision comes at the expense of precision for numbers further out" 1.…
The most useful feature of fixed point calculations is its deterministic nature. Determinism is necessary when multiple parties need to be in the same state, with the state being too large to be exchanged between the parties. The canonical example are RTS style games where there are hundreds of units, but only the actions of the players are sent to every other players. The result of the actions are computed independe…
(Many games have shipped with fp in networked code. see http://gafferongames.com/networking-for-game-programmers/flo... and look for previous discussion here on HN, reddit...)
Re: The fixed_point C++ Class Template
#23The negative exponent bothers me. Every implementation I've used specifies either mantissa bits or exponent bits, as a positive value. The extraneous '-' everywhere feels like a waste
The numbers are (integer_value * 2 ^ constant_exponent), such that all bits are dedicated to integer_value.