Giter Site home page Giter Site logo

fixed-point's Introduction

fixed-point

32 bit fixed-point*1 library

*1: Q format

Env

  • Linux: Ubuntu 18.04
  • gcc: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
  • etc.: gnuplot

Feature

Name Content
float_to_fr32(float real, uint8_t sft) Convert float to fixed-point
float_to_fr32_pih(uint8_t sft) Convert (float)M_PI/2 to fixed-point
double_to_fr32(double real, uint8_t sft) Convert double to fixed-point
double_to_fr32_pih(uint8_t sft) Convert (double)M_PI/2 to fixed-point
fr32_to_float(int32_t fr32, uint8_t sft) Convert fixed-point to float
fr32_to_double(int32_t fr32, uint8_t sft) Convert fixed-point to double
mul_fr32(int32_t a, int32_t b, uint8_t sft) Multiplication of fixed-point
div_fr32(int32_t a, int32_t b, uint8_t sft) Division of fixed-point
cos_fr32(int32_t x, uint8_t sft) Fixed-point cosine function
sin_fr32(int32_t x, uint8_t sft) Fixed-point sine function

Demo Cos(x)

$ make
$ ./build/fixed-point -t 6 -s 64 24

cos(x)

LICENSE

MIT License

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.