Ajoute le paquet mths

This commit is contained in:
2022-10-14 08:39:42 +02:00
commit 1d08d368d5
4 changed files with 52 additions and 0 deletions

23
mths/test/testMths.c Normal file
View File

@@ -0,0 +1,23 @@
#include "mths.h"
#include <assert.h>
#include <stdio.h>
int main(void) {
assert(MAX(5, 5) == 5);
assert(MAX(7, 2) == 7);
assert(MAX(4, 9) == 9);
assert(MIN(5, 5) == 5);
assert(MIN(7, 2) == 2);
assert(MIN(4, 9) == 4);
assert(LERP(0., 4., 0.) == 0.);
assert(LERP(0., 4., 0.25) == 1.);
assert(LERP(0., 4., 0.5) == 2.);
assert(LERP(0., 4., 0.75) == 3.);
assert(LERP(0., 4., 1.) == 4.);
printf("Success!\n");
return 0;
}