-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isalpha.c
24 lines (22 loc) · 1.04 KB
/
ft_isalpha.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abaudot <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/05 15:12:38 by abaudot #+# #+# */
/* Updated: 2021/01/06 18:33:39 by abaudot ### ########.fr */
/* */
/* ************************************************************************** */
/*
** 32 == 0b100000
** a == 0b1100001
** 96 = 0b1100000
** 96 - a = 100000000...
** 26 = 0b11010
*/
int ft_isalpha(int c)
{
return (((unsigned)c | 32) - 'a' < 26);
}