Author Topic: Fixed Point Math Lib for FreePascal  (Read 4007 times)


  • Newbie
  • Posts: 4
Fixed Point Math Lib for FreePascal
« on: January 29, 2012, 09:33:37 am »

I've made an independent fixed point math lib for FreePascal because i couldn't find one.

It's based in part on some other C fixed point math libs.

Any comments, further development, optimizations ... etc. are highly appreciated :)



  • Hero Member
  • *****
  • Posts: 2081
    • Additional info
Re: Fixed Point Math Lib for FreePascal
« Reply #1 on: January 31, 2012, 09:13:01 am »
Nice work. You can also take a look at my AFP (Arbitrary Fixed Point) math library here:;point;math
It is for E-Lab AvrCo Multitasking Pascal compiler (for Atmel AVR and Arduino microcontrollers). More info about this great compiler here:
Library let's you choose number of bits for integer and decimal part as long as total number of bits is 32, but it is not hard to adapt it to any other number. Basic trigonometry involved. More optimized Q31.32 version with 64 bits in total and full trigonometry is now part of the compiler. Besides many other things, it is used to accurately position an astronomy telescope and track the object from the sky in real time.

Update: Since E-Lab's forum software has changed, old messages have been lost. Therefore you can download AFP from AVR Freaks:
« Last Edit: April 26, 2017, 07:00:27 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib


TinyPortal © 2005-2018