FreeTDS API
Loading...
Searching...
No Matches
smp.h
1/* Simple multiprecision - small MP library for testing
2 * Copyright (C) 2022-2024 Frediano Ziglio
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20#ifndef _tdsguard_hfFl8IZw2Vf65YyyYQLJTS_
21#define _tdsguard_hfFl8IZw2Vf65YyyYQLJTS_
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 /* _tdsguard_hfFl8IZw2Vf65YyyYQLJTS_ */
Definition smp.h:26