4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 /* Copyright (c) 1988 AT&T */
24 /* All Rights Reserved */
27 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
35 #include <floatingpoint.h>
46 _doprnt(const char *format
, va_list in_args
, FILE *iop
);
49 _ndoprnt(const char *format
, va_list in_args
, FILE *iop
, int flag
);
52 _wndoprnt(const wchar_t *format
, va_list in_args
, FILE *iop
, int flag
);
55 __aconvert(double arg
, int ndigits
, int *exp
, int *sign
, char *buf
);
58 __qaconvert(long double *arg
, int ndigits
, int *exp
, int *sign
, char *buf
);
60 /* Maximum number of digits in any integer representation */
63 /* Maximum number of digits in any long long representation */
66 /* Maximum total number of digits in E format */
67 #define MAXECVT (DECIMAL_STRING_LENGTH-1)
69 /* Maximum number of digits after decimal point in F format */
70 #define MAXFCVT (DECIMAL_STRING_LENGTH-1)
72 /* Maximum significant figures in a floating-point number */
73 /* DECIMAL_STRING_LENGTH in floatingpoint.h is max buffer size */
74 #define MAXFSIG (DECIMAL_STRING_LENGTH-1)
76 /* Maximum number of characters in an exponent */
77 #define MAXESIZ 7 /* Max for quadruple precision */
79 /* Maximum (positive) exponent */
80 #define MAXEXP 4950 /* Max for quadruple precision */
82 /* Number of hex digits in a fp type when normalized with a leading 1 */
83 #define HEXFP_SINGLE_DIG 7
84 #define HEXFP_DOUBLE_DIG 14
85 #define HEXFP_EXTENDED_DIG 17
86 #define HEXFP_QUAD_DIG 29
88 /* Data type for flags */
91 /* Convert a digit character to the corresponding number */
92 #define tonumber(x) ((x)-'0')
94 /* Convert a number between 0 and 9 to the corresponding digit */
95 #define todigit(x) ((x)+'0')
97 /* Max and Min macros */
98 #define max(a, b) ((a) > (b)? (a): (b))
99 #define min(a, b) ((a) < (b)? (a): (b))
101 /* Max neg. long long */
102 #define HIBITLL (1ULL << 63)
108 #endif /* _PRINT_H */