X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=fltpoint.h;h=9704f5ee804d5dc83de1d3b316fce46ccf958783;hp=c3d4038709012046e195904c8988191b8c962ef9;hb=c59f7a33730dacf753e066a4002e2f749051a137;hpb=9153334781cd2e23750f4dc002e847606c07a1f0 diff --git a/fltpoint.h b/fltpoint.h index c3d4038..9704f5e 100644 --- a/fltpoint.h +++ b/fltpoint.h @@ -1,13 +1,21 @@ // -// Cross-platform floating point handling +// Cross-platform floating point handling (fixed point handling too!) // // by James Hammons -// (C) 2018 Underground Software +// (C) 2019 Underground Software // +#ifndef __FLTPOINT_H__ +#define __FLTPOINT_H__ + #include uint32_t FloatToIEEE754(float f); uint64_t DoubleToIEEE754(double d); void DoubleToExtended(double d, uint8_t out[]); +uint32_t DoubleToDSPFloat(double d); + +uint64_t DoubleToFixedPoint(double d, int intBits, int fracBits); + +#endif // __FLTPOINT_H__