- fix math error on ARM architectures

This commit is contained in:
Rachael Alexanderson 2022-12-28 02:07:10 -05:00
parent adc2396f31
commit 6b8bdcc449

View file

@ -3,6 +3,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <algorithm> #include <algorithm>
#include "xs_Float.h"
#define MAXWIDTH 12000 #define MAXWIDTH 12000
#define MAXHEIGHT 5000 #define MAXHEIGHT 5000
@ -103,12 +104,12 @@ inline double RAD2DEG(double rad)
inline angle_t RAD2BAM(float rad) inline angle_t RAD2BAM(float rad)
{ {
return angle_t(rad * float(0x80000000u / M_PI)); return angle_t(xs_RoundToUInt(rad * float(0x80000000u / M_PI)));
} }
inline angle_t RAD2BAM(double rad) inline angle_t RAD2BAM(double rad)
{ {
return angle_t(rad * (0x80000000u / M_PI)); return angle_t(xs_RoundToUInt(rad * (0x80000000u / M_PI)));
} }