FreeTDS API
Loading...
Searching...
No Matches
smp.h
1/* Simple multiprecision - small MP library for testing
2 * Copyright (C) 2022 Frediano Ziglio
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19
20#ifndef freetds_utils_smp_h_
21#define freetds_utils_smp_h_
22
23#include <tds_sysdep_public.h>
24#include <freetds/bool.h>
25
26typedef struct {
27 uint16_t comp[8];
28} smp;
29
30extern const smp smp_zero;
31extern const smp smp_one;
32
34smp smp_add(smp a, smp b);
35
37smp smp_sub(smp a, smp b);
38
40smp smp_not(smp a);
41
43smp smp_negate(smp a);
44
46smp smp_from_int(int64_t n);
47
49bool smp_is_negative(smp a);
50
52bool smp_is_zero(smp a);
53
55int smp_cmp(smp a, smp b);
56
58double smp_to_double(smp a);
59
61char *smp_to_string(smp a);
62
64smp smp_from_string(const char *s);
65
66#endif /* freetds_utils_smp_h_ */
Definition smp.h:26