Debian Codegraph @

external/gsl/gsl_ieee-utils__print.c

raw symbols SCIP
1 /* ieee-utils/print.c
2 *
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20 #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/
21 #include <stdio.h>
22 #include <math.h>
23 #include "gsl_ieee_utils.h"cxx . . $ `<file>/external/gsl/gsl_ieee_utils.h`/
24
25 /* A table of sign characters, 0=positive, 1=negative. We print a space
26 instead of a unary + sign for compatibility with bc */
27
28 static char signscxx . . $ signs.[2]={' ','-'} ;
29
30 void
31 gsl_ieee_fprintf_floatcxx . . $ gsl_ieee_fprintf_float(8f653c02e5f5ce49). (FILEcxx . . $ FILE# * stream, const float * x) {
32 gsl_ieee_float_repcxx . . $ gsl_ieee_float_rep# r ;
33 gsl_ieee_float_to_repcxx . . $ gsl_ieee_float_to_rep(2307f7fb15caa9b4).(x, &r) ;
34
35 switch (r.typecxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#type.)
36 {
37 case GSL_IEEE_TYPE_NANcxx . . $ GSL_IEEE_TYPE_NAN.:
38 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "NaN") ;
39 break ;
40 case GSL_IEEE_TYPE_INFcxx . . $ GSL_IEEE_TYPE_INF.:
41 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%cInf", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#sign.]) ;
42 break ;
43 case GSL_IEEE_TYPE_NORMALcxx . . $ GSL_IEEE_TYPE_NORMAL.:
44 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c1.%s*2^%d", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#sign.], r.mantissacxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#mantissa., r.exponentcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#exponent.) ;
45 break ;
46 case GSL_IEEE_TYPE_DENORMALcxx . . $ GSL_IEEE_TYPE_DENORMAL.:
47 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c0.%s*2^%d", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#sign.], r.mantissacxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#mantissa., r.exponentcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#exponent. + 1) ;
48 break ;
49 case GSL_IEEE_TYPE_ZEROcxx . . $ GSL_IEEE_TYPE_ZERO.:
50 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c0", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_1#sign.]) ;
51 break ;
52 default:
53 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "[non-standard IEEE float]") ;
54 }
55 }
56
57 void
58 gsl_ieee_printf_floatcxx . . $ gsl_ieee_printf_float(de58861cad56015a). (const float * x)
59 {
60 gsl_ieee_fprintf_floatcxx . . $ gsl_ieee_fprintf_float(8f653c02e5f5ce49). (stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!,x);
61 }
62
63 void
64 gsl_ieee_fprintf_doublecxx . . $ gsl_ieee_fprintf_double(6804af21c4b46b43). (FILEcxx . . $ FILE# * stream, const double * x) {
65 gsl_ieee_double_repcxx . . $ gsl_ieee_double_rep# r ;
66 gsl_ieee_double_to_repcxx . . $ gsl_ieee_double_to_rep(c86c14603ddda52b). (x, &r) ;
67
68 switch (r.typecxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#type.)
69 {
70 case GSL_IEEE_TYPE_NANcxx . . $ GSL_IEEE_TYPE_NAN.:
71 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "NaN") ;
72 break ;
73 case GSL_IEEE_TYPE_INFcxx . . $ GSL_IEEE_TYPE_INF.:
74 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%cInf", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#sign.]) ;
75 break ;
76 case GSL_IEEE_TYPE_NORMALcxx . . $ GSL_IEEE_TYPE_NORMAL.:
77 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c1.%s*2^%d", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#sign.], r.mantissacxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#mantissa., r.exponentcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#exponent.) ;
78 break ;
79 case GSL_IEEE_TYPE_DENORMALcxx . . $ GSL_IEEE_TYPE_DENORMAL.:
80 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c0.%s*2^%d", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#sign.], r.mantissacxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#mantissa., r.exponentcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#exponent. + 1) ;
81 break ;
82 case GSL_IEEE_TYPE_ZEROcxx . . $ GSL_IEEE_TYPE_ZERO.:
83 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "%c0", signscxx . . $ signs.[r.signcxx . . $ $anonymous_type_5ee4a8f360dc24ad_2#sign.]) ;
84 break ;
85 default:
86 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stream, "[non-standard IEEE double]") ;
87 }
88 }
89
90 void
91 gsl_ieee_printf_doublecxx . . $ gsl_ieee_printf_double(929f707f64635741). (const double * x)
92 {
93 gsl_ieee_fprintf_doublecxx . . $ gsl_ieee_fprintf_double(6804af21c4b46b43). (stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!,x);
94 }
95
96
97
98
99