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 | ||
13 | /* | |
14 | * Floating point scanf/printf (input/output) definitions. | |
15 | */ | |
16 | ||
17 | /* 11-bit exponent (VAX G floating point) is 308 decimal digits */ | |
18 | #define MAXEXP 308 | |
19 | /* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ | |
20 | #define MAXFRACT 39 | |
21 | ||
22 | /* | |
23 | * MAXEXPDIG is the maximum number of decimal digits needed to store a | |
24 | * floating point exponent in the largest supported format. It should | |
25 | * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point | |
26 | * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it | |
27 | * is presently never greater than 5 in practice, we fudge it. | |
28 | */ | |
29 | #define MAXEXPDIG 6 | |
30 | #if LDBL_MAX_EXP > 999999 | |
31 | #error "floating point buffers too small" | |
32 | #endif | |
33 | ||
1d18d519 MJ |
34 | char *__hdtoa(double, const char *, int, int *, int *, char **) |
35 | __attribute__((visibility("hidden"))); | |
ddabe860 | 36 | |
1d18d519 MJ |
37 | char *__hldtoa(long double, const char *, int, int *, int *, char **) |
38 | __attribute__((visibility("hidden"))); | |
ddabe860 | 39 | |
1d18d519 MJ |
40 | char *__ldtoa(long double *, int, int, int *, int *, char **) |
41 | __attribute__((visibility("hidden"))); |