]> Dogcows Code - chaz/yoink/blob - src/stlplus/strings/print_float.hpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / strings / print_float.hpp
1 #ifndef STLPLUS_PRINT_FLOAT
2 #define STLPLUS_PRINT_FLOAT
3 ////////////////////////////////////////////////////////////////////////////////
4
5 // Author: Andy Rushton
6 // Copyright: (c) Southampton University 1999-2004
7 // (c) Andy Rushton 2004-2009
8 // License: BSD License, see ../docs/license.html
9
10 // Convert a float/double to/from string
11
12 ////////////////////////////////////////////////////////////////////////////////
13 #include "strings_fixes.hpp"
14 #include "format_types.hpp"
15 #include <string>
16 #include <iostream>
17 #include <stdexcept>
18
19 namespace stlplus
20 {
21
22 ////////////////////////////////////////////////////////////////////////////////
23 // convert a real type to string
24 ////////////////////////////////////////////////////////////////////////////////
25
26 // Only decimal radix is supported
27
28 // The way in which the number is displayed is defined in radix_types.hpp
29 // Using any other value for the display type causes std::invalid_argument to be thrown
30
31 void print_float(std::ostream& device, float f,
32 real_display_t display = display_mixed,
33 unsigned width = 0,
34 unsigned precision = 6)
35 throw(std::invalid_argument);
36
37 void print_double(std::ostream& device, double f,
38 real_display_t display = display_mixed,
39 unsigned width = 0,
40 unsigned precision = 6)
41 throw(std::invalid_argument);
42
43 ////////////////////////////////////////////////////////////////////////////////
44
45 } // end namespace stlplus
46
47 #endif
This page took 0.030576 seconds and 4 git commands to generate.