1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9#ifndef __MMATH_H__
10#define __MMATH_H__
11#include "mal.h"
12#include "mal_exception.h"
13
14#define unopbaseM5_export(X1,X2)\
15mal_export str MATHunary##X1##X2(X2 *res, const X2 *a);
16
17#define unopM5_export(X1)\
18 unopbaseM5_export(X1,dbl)\
19 unopbaseM5_export(X1,flt)
20
21#define binopbaseM5_export(X1,X2,X3)\
22mal_export str MATHbinary##X1##X2(X2 *res, const X2 *a, const X3 *b);
23
24#define binopM5_export(X1)\
25 binopbaseM5_export(X1,dbl,dbl)\
26 binopbaseM5_export(X1,flt,flt)
27
28unopM5_export(_ACOS)
29unopM5_export(_ASIN)
30unopM5_export(_ATAN)
31binopM5_export(_ATAN2)
32unopM5_export(_COS)
33unopM5_export(_SIN)
34unopM5_export(_TAN)
35unopM5_export(_COT)
36
37unopM5_export(_COSH)
38unopM5_export(_SINH)
39unopM5_export(_TANH)
40unopM5_export(_RADIANS)
41unopM5_export(_DEGREES)
42
43unopM5_export(_EXP)
44unopM5_export(_LOG)
45unopM5_export(_LOG10)
46unopM5_export(_LOG2)
47binopM5_export(_LOG)
48
49binopM5_export(_POW)
50unopM5_export(_SQRT)
51unopM5_export(_CBRT)
52
53unopM5_export(_CEIL)
54unopbaseM5_export(_FABS,dbl)
55unopM5_export(_FLOOR)
56binopbaseM5_export(_ROUND,dbl,int)
57binopbaseM5_export(_ROUND,flt,int)
58
59mal_export str MATHunary_ISNAN(bit *res, const dbl *a);
60mal_export str MATHunary_ISINF(int *res, const dbl *a);
61mal_export str MATHunary_FINITE(bit *res, const dbl *a);
62mal_export str MATHrandint(int *res);
63mal_export str MATHrandintarg(int *res, const int *dummy);
64mal_export str MATHsrandint(void *ret, const int *seed);
65mal_export str MATHsqlrandint(int *res, const int *seed);
66mal_export str MATHpi(dbl *pi);
67mal_export str MATHprelude(void *ret);
68
69#endif /* __MMATH_H__ */
70