Permalink
Browse files

initial public release

  • Loading branch information...
gsarkis committed Jul 2, 2013
0 parents commit 5bd2f628eef693b0357c04f2c5fefd946540afe7
Showing with 12,704 additions and 0 deletions.
  1. +9 −0 .gitignore
  2. +1,933 −0 Doxyfile
  3. +674 −0 LICENSE
  4. +36 −0 README.md
  5. +627 −0 include/fi/Fixed.hpp
  6. +51 −0 include/fi/libfi.h
  7. +64 −0 include/fi/overflow/Exceptions.hpp
  8. +43 −0 include/fi/overflow/Saturate.hpp
  9. +45 −0 include/fi/overflow/Throw.hpp
  10. +43 −0 include/fi/overflow/Undefined.hpp
  11. +41 −0 include/fi/overflow/Wrap.hpp
  12. +43 −0 include/fi/private/Arithmetic.hpp
  13. +123 −0 include/fi/private/DoubleConversion.hpp
  14. +56 −0 include/fi/private/Fi.hpp
  15. +87 −0 include/fi/private/FixedConversion.hpp
  16. +633 −0 include/fi/private/Fixed_priv.hpp
  17. +35 −0 include/fi/private/Info.hpp
  18. +87 −0 include/fi/private/Limits.hpp
  19. +82 −0 include/fi/private/Masks.hpp
  20. +203 −0 include/fi/private/OverflowDetector.hpp
  21. +155 −0 include/fi/private/Parser.hpp
  22. +57 −0 include/fi/private/StaticAssert.hpp
  23. +276 −0 include/fi/private/StringConversion.hpp
  24. +172 −0 include/fi/private/StringMath.hpp
  25. +117 −0 include/fi/private/Traits.hpp
  26. +95 −0 include/fi/private/TypeFromRange.hpp
  27. +36 −0 include/fi/private/overflow/Exceptions_impl.hpp
  28. +93 −0 include/fi/private/overflow/Saturate.hpp
  29. +91 −0 include/fi/private/overflow/Throw.hpp
  30. +102 −0 include/fi/private/overflow/Undefined.hpp
  31. +112 −0 include/fi/private/overflow/Wrap.hpp
  32. +137 −0 include/fi/private/rounding/Ceil.hpp
  33. +181 −0 include/fi/private/rounding/Classic.hpp
  34. +140 −0 include/fi/private/rounding/Fix.hpp
  35. +141 −0 include/fi/private/rounding/Floor.hpp
  36. +44 −0 include/fi/rounding/Ceil.hpp
  37. +45 −0 include/fi/rounding/Classic.hpp
  38. +44 −0 include/fi/rounding/Fix.hpp
  39. +44 −0 include/fi/rounding/Floor.hpp
  40. +192 −0 tests/Binary_test.cpp
  41. +225 −0 tests/Ceil_test.cpp
  42. +227 −0 tests/Classic_test.cpp
  43. +615 −0 tests/Conversion_test.cpp
  44. +82 −0 tests/DoubleConversion_test.cpp
  45. +212 −0 tests/Fix_test.cpp
  46. +215 −0 tests/Floor_test.cpp
  47. +26 −0 tests/Makefile
  48. +50 −0 tests/OverflowDetector_test.cpp
  49. +62 −0 tests/StringConversion_test.cpp
  50. +167 −0 tests/StringMath_test.cpp
  51. +134 −0 tests/Undefined_test.cpp
  52. +220 −0 tests/construction8_test.cpp
  53. +137 −0 tests/construction_eq_test.cpp
  54. +222 −0 tests/construction_test.cpp
  55. +362 −0 tests/fixed_t7_test.cpp
  56. +526 −0 tests/fixed_t_test.cpp
  57. +105 −0 tests/fixed_t_test.m
  58. +92 −0 tests/min_max_val_test.cpp
  59. +199 −0 tests/negation_test.cpp
  60. +298 −0 tests/parsing_test.cpp
  61. +54 −0 tests/to_type_test.cpp
  62. +123 −0 tests/u_construction_test.cpp
  63. +652 −0 tests/ufixed_t_test.cpp
  64. +510 −0 tests/w_eq_f_test.cpp
@@ -0,0 +1,9 @@
+a.out
+*.o
+.*swp
+cscope.*
+\#*\#
+tests/*_test
+samples/*_sample
+doc/
+build/
1,933 Doxyfile

Large diffs are not rendered by default.

Oops, something went wrong.
674 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,36 @@
+# LibFi - Fixed-point C++ library
+
+----
+## What is LibFi?
+
+LibFi is a binary fixed-point arithmetic library for C++, focusing on flexibility and correctness. It is intended to be used for modeling hardware systems. LibFi is template-based and is a header-only library.
+
+Unlike most other C++ fixed-point libraries, the word length in Fi does not have to be a power of two, and the overflow behavior and rounding mode are customizable.
+
+This is a header-only library so you include `./fi/Fixed.hpp`, and any applicable overflow handlers and rounding modes from `./fi/overflow` and `./fi/rounding`.
+
+Here is an example of multiplying 8-bit signed fixed-point numbers with 4 fractional bits and wrap-around overflow handling:
+```cpp
+#include "fi/Fixed.hpp"
+
+#include <iostream>
+
+int main(int argc, char* argv[]) {
+
+ Fi::Fixed<8, 4, Fi::SIGNED, Fi::Wrap> a("3.14");
+ Fi::Fixed<8, 4, Fi::SIGNED, Fi::Wrap> b("13.14");
+
+ std::cout << a*b << std::endl;
+
+ return 0;
+
+}
+```
+
+----
+## Documentation
+LibFi is documented using Doxygen. To build the documentation, you need [Doxygen](http://www.doxygen.org). In the library's root directory, run `doxygen`. The documentation will be available in `doc/html/index.html`.
+
+----
+## Changelog
+* 2013-07-02 v1.0: First public release of LibFi.
Oops, something went wrong.

0 comments on commit 5bd2f62

Please sign in to comment.