summaryrefslogtreecommitdiff
path: root/sys/src/libc/port/abs.c
blob: 7e8adda550e3c431aad34f9d8969473e90e09137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <u.h>
#include <libc.h>

int
abs(int a)
{
	if(a < 0)
		return -a;
	return a;
}

long
labs(long a)
{
	if(a < 0)
		return -a;
	return a;
}