42-archive/libft/srcs/math/ft_ilen_base.c
2017-03-31 18:40:30 +02:00

23 lines
1,012 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ilen_base.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:53:53 by jhalford #+# #+# */
/* Updated: 2016/11/07 14:45:28 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_ilen_base(int n, int base)
{
size_t i;
i = 1;
while (n /= base)
i++;
return (i);
}