TFixPoint library 

You are free to use the following source code for your personal projects.
You can use it within your commercial projects too, in that case you shall email me first (just so I'm aware that you are using it).

The usual disclaimer applies: I don't give you any express or implied warranties about this source code, including without limitation the warranty that it is free of defects, or that it will work on every system, although I did my best to make it portable. All the source code available in this page is provided "as is".

NOTE: If you modify this source code in some useful way to the community, please make me know and I'll make it available to everybody.


TFixPoint library

I made this TFixPoint library after working with fixed-point arithmetic on portable devices (ARM architecture).
I tested it succesfully with vc++ and with gcc 4 under Mac OS X, Windows, Linux.

I thought it was time to abandon those postfix functions to have some nice c++ object-oriented incapsulation of the data type.

Main features:
  • Object incapsulation of the fixed-point data type
  • Template parameters specify decimal precision
  • Use infix overloaded operators (+,*,..) in complex expressions instead of postfix functions (MUL,DIV,..)
  • Template optimized inlines produce fastest code (code bloat is prevented)
  • Easy and precise conversion among different decimal resolutions
  • Math functions (interoperating with standard data types)
  • Vector processing
Ease of programming and code readibility come along with great performance and precision.

Project for XCode, VS2005 and a simple makefile are provided.
The sample test project included will be replaced by a serious testing suite, hopefully soon!


Documentation

Here comes the online documentation for my TFixPoint library, also available within the downloaded archive.

Generated with the powerful doxygen.