/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_intlen_base.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:06:39 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:06:39 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include unsigned char ft_intlen_base(long n, char *base) { unsigned char len; unsigned char size; size = ft_strlen(base); len = 0; if (n == 0) return (1); if (n < 0) len = 1; while (n != 0) { n /= size; len++; } return (len); }