Debian Codegraph @

external/gsl/gsl_ieee-utils__env.c

raw symbols SCIP
1 /* ieee-utils/env.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 <stdlib.h>
22 #include "gsl_ieee_utils.h"cxx . . $ `<file>/external/gsl/gsl_ieee_utils.h`/
23 #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/
24
25 void
26 gsl_ieee_env_setupcxx . . $ gsl_ieee_env_setup(49f6e7a06ebc5aa8). (void)
27 {
28 const char * p = getenvcxx . . $ getenv(a8b8e32347182212).("GSL_IEEE_MODE") ;
29
30 int precision = 0, rounding = 0, exception_mask = 0 ;
31
32 int comma = 0 ;
33
34 if (p == 0) /* GSL_IEEE_MODE environment variable is not set */
35 return ;
36
37 if (*p == '\0') /* GSL_IEEE_MODE environment variable is empty */
38 return ;
39
40 gsl_ieee_read_mode_stringcxx . . $ gsl_ieee_read_mode_string(734c67af0d2342a1). (p, &precision, &rounding, &exception_mask) ;
41
42 gsl_ieee_set_modecxx . . $ gsl_ieee_set_mode(2326284602b0bb2d). (precision, rounding, exception_mask) ;
43
44 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "GSL_IEEE_MODE=\"") ;
45
46 /* Print string with a preceeding comma if the list has already begun */
47
48 #define PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!(x) do {if(comma) fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,","); fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,x); comma++ ;} while(0)
49
50 switch (precision)
51 {
52 case GSL_IEEE_SINGLE_PRECISIONcxx . . $ GSL_IEEE_SINGLE_PRECISION.:
53 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("single-precision") ;
54 break ;
55 case GSL_IEEE_DOUBLE_PRECISIONcxx . . $ GSL_IEEE_DOUBLE_PRECISION.:
56 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("double-precision") ;
57 break ;
58 case GSL_IEEE_EXTENDED_PRECISIONcxx . . $ GSL_IEEE_EXTENDED_PRECISION.:
59 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("extended-precision") ;
60 break ;
61 }
62
63 switch (rounding)
64 {
65 case GSL_IEEE_ROUND_TO_NEARESTcxx . . $ GSL_IEEE_ROUND_TO_NEAREST.:
66 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("round-to-nearest") ;
67 break ;
68 case GSL_IEEE_ROUND_DOWNcxx . . $ GSL_IEEE_ROUND_DOWN.:
69 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("round-down") ;
70 break ;
71 case GSL_IEEE_ROUND_UPcxx . . $ GSL_IEEE_ROUND_UP.:
72 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("round-up") ;
73 break ;
74 case GSL_IEEE_ROUND_TO_ZEROcxx . . $ GSL_IEEE_ROUND_TO_ZERO.:
75 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("round-to-zero") ;
76 break ;
77 }
78
79 if ((exception_mask & GSL_IEEE_MASK_ALLcxx . . $ GSL_IEEE_MASK_ALL.) == GSL_IEEE_MASK_ALLcxx . . $ GSL_IEEE_MASK_ALL.)
80 {
81 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-all") ;
82 }
83 else if ((exception_mask & GSL_IEEE_MASK_ALLcxx . . $ GSL_IEEE_MASK_ALL.) == 0)
84 {
85 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("trap-common") ;
86 }
87 else
88 {
89 if (exception_mask & GSL_IEEE_MASK_INVALIDcxx . . $ GSL_IEEE_MASK_INVALID.)
90 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-invalid") ;
91
92 if (exception_mask & GSL_IEEE_MASK_DENORMALIZEDcxx . . $ GSL_IEEE_MASK_DENORMALIZED.)
93 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-denormalized") ;
94
95 if (exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZEROcxx . . $ GSL_IEEE_MASK_DIVISION_BY_ZERO.)
96 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-division-by-zero") ;
97
98 if (exception_mask & GSL_IEEE_MASK_OVERFLOWcxx . . $ GSL_IEEE_MASK_OVERFLOW.)
99 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-overflow") ;
100
101 if (exception_mask & GSL_IEEE_MASK_UNDERFLOWcxx . . $ GSL_IEEE_MASK_UNDERFLOW.)
102 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("mask-underflow") ;
103 }
104
105 if (exception_mask & GSL_IEEE_TRAP_INEXACTcxx . . $ GSL_IEEE_TRAP_INEXACT.)
106 PRINTCcxx . . $ `external/gsl/gsl_ieee-utils__env.c:48:9`!("trap-inexact") ;
107
108 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,"\"\n") ;
109 }
110
111
112
113
114