Code Monkey home page Code Monkey logo

fptc-lib's Introduction

Fixed Point Math Library for C

This repository contains a fork of Fixed Point Math Library for C improved with some additional functionalities.

Build Status

Features of original library:

  • Fixed point math library
  • Requires a fairly modern C compiler with uint32_t and uint64_t
  • 32-bit and 64-bit precision support (for compilers with __int128_t extensions like gcc)
  • Arbitrary precision point (e.g. 24.8 or 32.32)
  • Pure header-only
  • Pure integer-only (suitable for kernels, embedded CPUs, etc)

This version features also

  • Floating point free conversion from strings to fpt values
  • Conversion from fpt to string returns string size
  • Normalized conversion between fpt and int
  • Over/underflow detection and handling
  • And other minor improvements...

Normalization

Once the decimal point position is chosen, it is set for the whole project. Normalization is useful, when some of the variables are of the different order of magnitude than others. The idea here is to scale the variables so they are represented by a variable with approximately unary order of magnitude, and then, when the calculations are finished, to scale back to original form.

equation

It is the developer duty to keep track of which variable has which normalization factor applied. Usefulness of such approach was proven for cases such as discrete adaptive control system implementation or solving of a linear equation systems via matrix decomposition.

License

This modified library is released under the same license as the original one, ie. BSD-2. LICENSE file features original authors copyrights disclosures.

fptc-lib's People

Contributors

mgetka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.