//
//  numberConversion.h
//  GSFontTools
//
//  Created by Alex on 13.06.17.
//
//

#ifndef numberConversion_h
#define numberConversion_h

#include <stdint.h>

typedef int16_t F2DOT14_t;

double Fixed14ToFloat(F2DOT14_t value);

F2DOT14_t FloatToFixed14(double value);

//#define Fixed14ToFloat(a) ((double)(a) / (1 << 14))
//#define FloatToFixed14(a) (roundf((float)(a) * (1 << 14)))

#define Fixed16ToFloat(a) ((double)(a) / (1 << 16))
#define FloatToFixed16(a) (int32_t)(round((double)(a) * (1 << 16)))


#define dmax(x, y) (((x) > (y)) ? (x) : (y))
#define dmin(x, y) (((x) < (y)) ? (x) : (y))

#endif /* numberConversion_h */
