From 82c445502b2a44b71971c9806ada190fe951d80e Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 17 Sep 2025 16:42:17 +0200 Subject: [PATCH] feat(math/ft_max): adding ft_max - Using the bitwise for fun :eyes: --- math/ft_max.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 math/ft_max.c diff --git a/math/ft_max.c b/math/ft_max.c new file mode 100644 index 0000000..6d9c1d7 --- /dev/null +++ b/math/ft_max.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_max.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/09/17 16:23:22 by rparodi #+# #+# */ +/* Updated: 2025/09/17 16:24:17 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include + +uint32_t ft_max(uint32_t x, uint32_t y) +{ + return (x ^ ((x ^ y) & -(x < y))); +}