import upstream maccel baseline
Tests / test_core_function (push) Failing after 12s

This commit is contained in:
2026-03-24 12:10:31 +00:00
parent 6e948d7b39
commit 5f1254d11a
108 changed files with 18930 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef _MATH_H_
#define _MATH_H_
#include "fixedptc.h"
struct vector {
fpt x;
fpt y;
};
static inline fpt magnitude(struct vector v) {
fpt x_square = fpt_mul(v.x, v.x);
fpt y_square = fpt_mul(v.y, v.y);
fpt x_square_plus_y_square = fpt_add(x_square, y_square);
dbg("dx^2 (in) %s", fptoa(x_square));
dbg("dy^2 (in) %s", fptoa(y_square));
dbg("square modulus (in) %s", fptoa(x_square_plus_y_square));
return fpt_sqrt(x_square_plus_y_square);
}
static inline fpt minsd(fpt a, fpt b) { return (a < b) ? a : b; }
#endif // !_MATH_H_