1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-11 07:16:05 +00:00

Added fxpt64_to_double

This commit is contained in:
Cillian O'Driscoll
2015-11-19 11:11:53 +00:00
parent 0efbff494e
commit 3d4f3704f6
2 changed files with 8 additions and 0 deletions

View File

@@ -41,3 +41,10 @@ int64_t double_to_fxpt64( double in, unsigned int frac_len )
return out;
}
double fxpt64_to_double( int64_t in, unsigned int frac_len )
{
double out = static_cast< double >( in ) * std::pow( 2.0, -static_cast<double>(frac_len) );
return out;
}

View File

@@ -36,5 +36,6 @@
#include <cstdint>
int64_t double_to_fxpt64( double in, unsigned int frac_len = 32 );
double fxpt64_to_double( int64_t in, unsigned int frac_len = 32 );
#endif