feat(math/ft_min): adding ft_min

- Using the bitwise for fun 👀
This commit is contained in:
Raphael 2025-09-17 16:42:24 +02:00
parent 82c445502b
commit d8ac7d2b88
No known key found for this signature in database

18
math/ft_min.c Normal file
View file

@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_min.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/17 16:20:11 by rparodi #+# #+# */
/* Updated: 2025/09/17 16:25:27 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdint.h>
uint32_t ft_min(uint32_t x, uint32_t y)
{
return (y ^ ((x ^ y) & -(x < y)));
}