FreeTDS API
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 
26 typedef struct {
27  uint16_t comp[8];
28 } smp;
29 
30 extern const smp smp_zero;
31 extern const smp smp_one;
32 
34 smp smp_add(smp a, smp b);
35 
37 smp smp_sub(smp a, smp b);
38 
40 smp smp_not(smp a);
41 
43 smp smp_negate(smp a);
44 
46 smp smp_from_int(int64_t n);
47 
49 bool smp_is_negative(smp a);
50 
52 bool smp_is_zero(smp a);
53 
55 int smp_cmp(smp a, smp b);
56 
58 double smp_to_double(smp a);
59 
61 char *smp_to_string(smp a);
62 
64 smp smp_from_string(const char *s);
65 
66 #endif /* freetds_utils_smp_h_ */
smp
Definition: smp.h:26