The fixed_point C++ Class Template
github.com
The fixed_point C++ Class Template
1–10 of 23 posts
Re: The fixed_point C++ Class Template
#2[1] https://en.wikipedia.org/wiki/C%2B%2B11#User-defined_literal...
Re: The fixed_point C++ Class Template
#3Looks useful!
Re: The fixed_point C++ Class Template
#4Phew! I was thinking this was going to be a template-meta programming example of a y-combinator... Looks useful!
Re: The fixed_point C++ Class Template
#5Re: The fixed_point C++ Class Template
#6Two 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. http://www.pathengine.com/Contents/Overview/FundamentalConce...
Re: The fixed_point C++ Class Template
#7Re: The fixed_point C++ Class Template
#8I 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.…
Re: The fixed_point C++ Class Template
#9I 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.…
Re: The fixed_point C++ Class Template
#10I 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.…
A two-byte fixed-point number is likely to be less expensive to deal with than a two-byte floating-point number. (Promotion and demotion cost is pretty high for small floating-point types (bit masking, shifting, oring, etc.) compared to fixed-point promotion and demotion (shift).)