summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-12-17 14:16:17 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-12-17 14:16:17 +0100
commit2543e1e9838e03adb7f4a811815d34ccf65a3026 (patch)
tree92fd5e78541bb9c244741de5940e8332e5e983dc /src/misc.c
parent6eddfddeb9da77b6523d8e1ebc2e75c8b5dc5ac9 (diff)
parent08dcb1504d4900cb6230c99fbbf535c63eb3b332 (diff)
Merge branch 'release/debian/4.17-1'HEADmaster
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index 7778b08..c138f23 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -7,6 +7,7 @@
* General Public License as published by the Free Software Foundation;
* either version 2.1 or (at your option) any later version.
*/
+#include <math.h> /* fmod */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -88,3 +89,19 @@ EXPORT_SYMBOL void HX_zvecfree(char **args)
free(*travp);
free(args);
}
+
+EXPORT_SYMBOL float HX_flprf(float x, float y)
+{
+ float r = fmodf(x, y);
+ if (r < 0)
+ r += y;
+ return r;
+}
+
+EXPORT_SYMBOL double HX_flpr(double x, double y)
+{
+ double r = fmod(x, y);
+ if (r < 0)
+ r += y;
+ return r;
+}