ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
ieee_utils.hpp
Go to the documentation of this file.
1/*
2 * $Id: ieee_utils.hpp 230 2012-08-08 19:41:17Z jdl3 $
3 * Copyright (C) 2012, 2020 John D Lamb
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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef CCGSL_IEEE_UTILS_HPP
21#define CCGSL_IEEE_UTILS_HPP
22
23#include<gsl/gsl_ieee_utils.h>
24
25namespace gsl {
29 namespace ieee {
30#ifndef DOXYGEN_SKIP
34 typedef gsl_ieee_float_rep float_rep;
38 typedef gsl_ieee_double_rep double_rep;
39#endif /* DOXYGEN_SKIP */
40#ifndef DOXYGEN_SKIP
45 inline void printf_float( float const* x ){ gsl_ieee_printf_float( x ); }
46#endif /* DOXYGEN_SKIP */
51 inline void printf_float( float const& x ){ gsl_ieee_printf_float( &x ); }
52
53#ifndef DOXYGEN_SKIP
58 inline void printf_double( double const* x ){ gsl_ieee_printf_double( x ); }
59#endif /* DOXYGEN_SKIP */
64 inline void printf_double( double const& x ){ gsl_ieee_printf_double( &x ); }
65
66#ifndef DOXYGEN_SKIP
72 inline void fprintf_float( FILE* stream, float const* x ){
73 gsl_ieee_fprintf_float( stream, x ); }
74#endif /* DOXYGEN_SKIP */
80 inline void fprintf_float( FILE* stream, float const& x ){
81 gsl_ieee_fprintf_float( stream, &x ); }
82
83#ifndef DOXYGEN_SKIP
89 inline void fprintf_double( FILE* stream, double const* x ){
90 gsl_ieee_fprintf_double( stream, x ); }
91#endif /* DOXYGEN_SKIP */
97 inline void fprintf_double( FILE* stream, double const& x ){
98 gsl_ieee_fprintf_double( stream, &x ); }
99
100#ifndef DOXYGEN_SKIP
106 inline void float_to_rep( float const* x, float_rep* r ){
107 gsl_ieee_float_to_rep( x, r ); }
108
114 inline void double_to_rep( double const* x, double_rep* r ){
115 gsl_ieee_double_to_rep( x, r ); }
116#endif /* DOXYGEN_SKIP */
117
121 inline void env_setup(){ gsl_ieee_env_setup(); }
122
123#ifndef DOXYGEN_SKIP
132 inline int read_mode_string( char const* description, int* precision, int* rounding,
133 int* exception_mask ){
134 return gsl_ieee_read_mode_string( description, precision, rounding, exception_mask ); }
135#endif /* DOXYGEN_SKIP */
144 inline int read_mode_string( char const* description, int& precision, int& rounding,
145 int& exception_mask ){
146 return gsl_ieee_read_mode_string( description, &precision, &rounding, &exception_mask ); }
147
155 inline int set_mode( int precision, int rounding, int exception_mask ){
156 return gsl_ieee_set_mode( precision, rounding, exception_mask ); }
157
158 }
159}
160#endif
int read_mode_string(char const *description, int &precision, int &rounding, int &exception_mask)
C++ version of gsl_ieee_read_mode_string().
Definition: ieee_utils.hpp:144
void printf_double(double const &x)
C++ version of gsl_ieee_printf_double().
Definition: ieee_utils.hpp:64
void env_setup()
C++ version of gsl_ieee_env_setup().
Definition: ieee_utils.hpp:121
void printf_float(float const &x)
C++ version of gsl_ieee_printf_float().
Definition: ieee_utils.hpp:51
int set_mode(int precision, int rounding, int exception_mask)
C++ version of gsl_ieee_set_mode().
Definition: ieee_utils.hpp:155
void fprintf_double(FILE *stream, double const &x)
C++ version of gsl_ieee_fprintf_double().
Definition: ieee_utils.hpp:97
void fprintf_float(FILE *stream, float const &x)
C++ version of gsl_ieee_fprintf_float().
Definition: ieee_utils.hpp:80
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34