Commit | Line | Data |
---|---|---|
bf0d695d PMF |
1 | /* $OpenBSD: floatio.h,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ |
2 | ||
c0c0989a MJ |
3 | /* |
4 | * SPDX-License-Identifier: BSD-3-Clause | |
5 | * | |
6 | * Copyright (C) 1990, 1993 | |
bf0d695d PMF |
7 | * The Regents of the University of California. All rights reserved. |
8 | * | |
9 | * This code is derived from software contributed to Berkeley by | |
10 | * Chris Torek. | |
bf0d695d PMF |
11 | */ |
12 | ||
e88c7263 MJ |
13 | #include "ust-helper.h" |
14 | ||
bf0d695d PMF |
15 | /* |
16 | * Floating point scanf/printf (input/output) definitions. | |
17 | */ | |
18 | ||
19 | /* 11-bit exponent (VAX G floating point) is 308 decimal digits */ | |
20 | #define MAXEXP 308 | |
21 | /* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ | |
22 | #define MAXFRACT 39 | |
23 | ||
24 | /* | |
25 | * MAXEXPDIG is the maximum number of decimal digits needed to store a | |
26 | * floating point exponent in the largest supported format. It should | |
27 | * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point | |
28 | * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it | |
29 | * is presently never greater than 5 in practice, we fudge it. | |
30 | */ | |
31 | #define MAXEXPDIG 6 | |
32 | #if LDBL_MAX_EXP > 999999 | |
33 | #error "floating point buffers too small" | |
34 | #endif | |
35 | ||
e88c7263 | 36 | LTTNG_HIDDEN |
bf0d695d | 37 | char *__hdtoa(double, const char *, int, int *, int *, char **); |
e88c7263 | 38 | LTTNG_HIDDEN |
bf0d695d | 39 | char *__hldtoa(long double, const char *, int, int *, int *, char **); |
e88c7263 | 40 | LTTNG_HIDDEN |
bf0d695d | 41 | char *__ldtoa(long double *, int, int, int *, int *, char **); |