/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf_utils.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: lderidde +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/28 10:42:48 by lderidde #+# #+# */ /* Updated: 2024/11/04 09:23:14 by lderidde ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_fprintf.h" int num_len(long n) { int i; i = 0; if (n < 0) { n *= -1; i++; } while (n > 9) { n /= 10; i++; } i++; return (i); } int hex_len(unsigned long num) { int i; i = 0; while (num > 15) { num /= 16; i++; } i++; return (i); }