diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2017-02-11 13:55:41 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2017-02-11 13:55:41 -0800 |
commit | 45f4d6c7e8678e140b363f3114b5393ed1f29681 (patch) | |
tree | 4c59d7ba61a8612cde9e056153b9e609ec1104fb /src/misc/util/abc_global.h | |
parent | ab2d3acac99620aef7d5b1c48eb59ee33bb2b584 (diff) | |
download | abc-45f4d6c7e8678e140b363f3114b5393ed1f29681.tar.gz abc-45f4d6c7e8678e140b363f3114b5393ed1f29681.tar.bz2 abc-45f4d6c7e8678e140b363f3114b5393ed1f29681.zip |
Movinng custom floating-point implementations, etc.
Diffstat (limited to 'src/misc/util/abc_global.h')
-rw-r--r-- | src/misc/util/abc_global.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 00d5d514..9e906816 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -225,6 +225,8 @@ static inline double Abc_MinDouble( double a, double b ) { return a < b ? static inline int Abc_Float2Int( float Val ) { union { int x; float y; } v; v.y = Val; return v.x; } static inline float Abc_Int2Float( int Num ) { union { int x; float y; } v; v.x = Num; return v.y; } +static inline word Abc_Dbl2Word( double Dbl ) { union { word x; double y; } v; v.y = Dbl; return v.x; } +static inline double Abc_Word2Dbl( word Num ) { union { word x; double y; } v; v.x = Num; return v.y; } static inline int Abc_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ) {}; return r; } static inline int Abc_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ) {}; return r; } static inline int Abc_Base16Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 16, r++ ) {}; return r; } |