8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libbc / libc / gen / common / float_decim.c
blobf532e8b2c5b2de75d8e1c61df19186fea2715fba
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
22 #pragma ident "%Z%%M% %I% %E% SMI"
25 * Copyright (c) 1988 by Sun Microsystems, Inc.
29 * Conversion between single, and extended binary and decimal
30 * floating point - separated from double_to_decimal to minimize impact on
31 * main(){printf("Hello");}
34 #include "base_conversion.h"
36 void
37 single_to_decimal(px, pm, pd, ps)
38 single *px;
39 decimal_mode *pm;
40 decimal_record *pd;
41 fp_exception_field_type *ps;
43 single_equivalence kluge;
44 unpacked u;
46 *ps = 0; /* Initialize *ps - no exceptions. */
47 kluge.x = *px;
48 pd->sign = kluge.f.msw.sign;
49 pd->fpclass = _class_single(px);
50 switch (pd->fpclass) {
51 case fp_zero:
52 break;
53 case fp_infinity:
54 break;
55 case fp_quiet:
56 break;
57 case fp_signaling:
58 break;
59 default:
60 _unpack_single(&u, &kluge.x);
61 _unpacked_to_decimal(&u, pm, pd, ps);
65 void
66 extended_to_decimal(px, pm, pd, ps)
67 extended *px;
68 decimal_mode *pm;
69 decimal_record *pd;
70 fp_exception_field_type *ps;
72 extended_equivalence kluge;
73 unpacked u;
75 *ps = 0; /* Initialize *ps - no exceptions. */
76 kluge.x[0] = (*px)[0];
77 kluge.x[1] = (*px)[1];
78 kluge.x[2] = (*px)[2];
79 pd->sign = kluge.f.msw.sign;
80 pd->fpclass = _class_extended(px);
81 switch (pd->fpclass) {
82 case fp_zero:
83 break;
84 case fp_infinity:
85 break;
86 case fp_quiet:
87 break;
88 case fp_signaling:
89 break;
90 default:
91 _unpack_extended(&u, px);
92 _unpacked_to_decimal(&u, pm, pd, ps);