-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_maxminrange.c
More file actions
20 lines (19 loc) · 1.04 KB
/
ft_maxminrange.c
File metadata and controls
20 lines (19 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_maxminrange.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marvin <marvin@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/23 18:38:00 by bwebb #+# #+# */
/* Updated: 2019/06/13 16:49:08 by bwebb ### ########.fr */
/* */
/* ************************************************************************** */
int ft_maxminrange(int min, int max)
{
if (min < 0 && max < 0)
return ((min * -1) + max);
if (min < 0 && max >= 0)
return (max + (min * -1) + 1);
return (max - min);
}