summaryrefslogtreecommitdiffstats
path: root/src/common/utils.c
blob: 7bcf767d00944df542bcda9edea80851a0c7e331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "utils.h"

fpi1_t add(fpi1_t a, fpi1_t b)
{
	return a + b;
}

fpi1_t sub(fpi1_t a, fpi1_t b)
{
	return a - b;
}

fpi1_t mul(fpi1_t a, fpi1_t b)
{
	return (fpi1_t)(((long)a * (long)b) / 100);
}

fpi1_t div(fpi1_t a, fpi1_t b)
{
	return (fpi1_t)(((long)a * 10) / ((long)b * 10));
}