Skip to content

jsaka1259/fixed-point

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

32-bit fixed-point library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published