-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemsizebin.c
27 lines (25 loc) · 1.03 KB
/
memsizebin.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* memsizebin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yst-laur <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/09 14:19:46 by yst-laur #+# #+# */
/* Updated: 2022/03/09 14:19:51 by yst-laur ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int memsizebin(unsigned long long n)
{
long long i;
i = 0;
if (n == 0)
return (1);
while (n != 0)
{
i++;
n /= 2;
}
return (i);
}