2018-01-21 16:25:06 +02:00
|
|
|
//
|
2018-02-26 05:39:59 +02:00
|
|
|
// Cross-platform floating point handling (fixed point handling too!)
|
2018-01-21 16:25:06 +02:00
|
|
|
//
|
2018-02-10 07:08:47 +02:00
|
|
|
// by James Hammons
|
2019-08-06 18:16:20 +03:00
|
|
|
// (C) 2019 Underground Software
|
2018-02-10 07:08:47 +02:00
|
|
|
//
|
2018-01-21 16:25:06 +02:00
|
|
|
|
2018-02-26 05:39:59 +02:00
|
|
|
#ifndef __FLTPOINT_H__
|
|
|
|
#define __FLTPOINT_H__
|
|
|
|
|
2018-01-21 16:25:06 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
uint32_t FloatToIEEE754(float f);
|
|
|
|
uint64_t DoubleToIEEE754(double d);
|
|
|
|
void DoubleToExtended(double d, uint8_t out[]);
|
2019-08-08 05:15:19 +03:00
|
|
|
uint32_t DoubleToDSPFloat(double d);
|
2018-01-21 16:25:06 +02:00
|
|
|
|
2018-02-26 05:39:59 +02:00
|
|
|
uint64_t DoubleToFixedPoint(double d, int intBits, int fracBits);
|
|
|
|
|
|
|
|
#endif // __FLTPOINT_H__
|
|
|
|
|