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{
28 uint16_t comp[8];
29} smp;
30
31extern const smp smp_zero;
32extern const smp smp_one;
33
35smp smp_add(smp a, smp b);
36
38smp smp_sub(smp a, smp b);
39
41smp smp_not(smp a);
42
44smp smp_negate(smp a);
45
47smp smp_from_int(int64_t n);
48
50bool smp_is_negative(smp a);
51
53bool smp_is_zero(smp a);
54
56int smp_cmp(smp a, smp b);
57
59double smp_to_double(smp a);
60
62char *smp_to_string(smp a);
63
65smp smp_from_string(const char *s);
66
67#endif /* _tdsguard_hfFl8IZw2Vf65YyyYQLJTS_ */
Definition smp.h:27