Started from buttom go to the sky

This commit is contained in:
Raphaël 2024-04-28 19:59:01 +02:00
parent 96215449bd
commit f811e55dea
4781 changed files with 10121 additions and 1743 deletions

View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rotate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/11 14:08:55 by maiboyer #+# #+# */
/* Updated: 2023/12/11 14:13:32 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "me/num/u32.h"
t_u32 u32_rotate_left(t_u32 value, t_usize by)
{
by &= sizeof(value) * 8 - 1;
if (by == 0)
return (value);
return ((value << by) | (value >> (sizeof(value) * 8 - by)));
}
t_u32 u32_rotate_right(t_u32 value, t_usize by)
{
by &= sizeof(value) * 8 - 1;
if (by == 0)
return (value);
return ((value >> by) | (value << (sizeof(value) * 8 - by)));
}