Move to kernel style SPDX license identifiers
[lttng-ust.git] / snprintf / floatio.h
1 /* $OpenBSD: floatio.h,v 1.4 2008/09/07 20:36:08 martynas Exp $ */
2
3 /*
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Copyright (C) 1990, 1993
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.
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
34 char *__hdtoa(double, const char *, int, int *, int *, char **);
35 char *__hldtoa(long double, const char *, int, int *, int *, char **);
36 char *__ldtoa(long double *, int, int, int *, int *, char **);
This page took 0.028857 seconds and 4 git commands to generate.