SRCmath := ft_abs.c \
ft_sgn.c \
+ ft_max.c \
+ ft_min.c \
SRCstr := ft_strncat_alloc.c \
ft_strcmp.c \
--- /dev/null
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_max.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/02/22 14:29:48 by ljiriste #+# #+# */
+/* Updated: 2024/02/23 08:57:26 by ljiriste ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "ft_math.h"
+#include <stddef.h>
+
+int ft_max(int a, int b)
+{
+ if (a > b)
+ return (a);
+ return (b);
+}
+
+size_t ft_maxs(size_t a, size_t b)
+{
+ if (a > b)
+ return (a);
+ return (b);
+}
--- /dev/null
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_min.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/02/23 08:58:39 by ljiriste #+# #+# */
+/* Updated: 2024/02/23 08:59:40 by ljiriste ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "ft_math.h"
+#include <stddef.h>
+
+int ft_min(int a, int b)
+{
+ if (a < b)
+ return (a);
+ return (b);
+}
+
+size_t ft_mins(size_t a, size_t b)
+{
+ if (a < b)
+ return (a);
+ return (b);
+}
/* By: ljiriste <ljiriste@student.42prague.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/09 12:19:15 by ljiriste #+# #+# */
-/* Updated: 2024/01/18 09:44:29 by ljiriste ### ########.fr */
+/* Updated: 2024/02/23 09:01:20 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_MATH_H
# define FT_MATH_H
+# include <stddef.h>
+
int ft_abs(int n);
int ft_sgn(int n);
+int ft_max(int a, int b);
+size_t ft_maxs(size_t a, size_t b);
+
+int ft_min(int a, int b);
+size_t ft_mins(size_t a, size_t b);
+
#endif