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

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

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