X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fstrings%2Fprint_float.hpp;h=9ee54ee68b823e8bce27567ebd00a1b96000dc72;hp=2de8b8fb0898a007ad4d619bc7e87b3cddca8242;hb=5846afb00833cc72fe72422ca896d2387c712cb4;hpb=a97500609dc3c1b11f9786d32bc458eb00de4c36 diff --git a/src/stlplus/strings/print_float.hpp b/src/stlplus/strings/print_float.hpp index 2de8b8f..9ee54ee 100644 --- a/src/stlplus/strings/print_float.hpp +++ b/src/stlplus/strings/print_float.hpp @@ -1,47 +1,47 @@ -#ifndef STLPLUS_PRINT_FLOAT -#define STLPLUS_PRINT_FLOAT -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -// Convert a float/double to/from string - -//////////////////////////////////////////////////////////////////////////////// -#include "strings_fixes.hpp" -#include "format_types.hpp" -#include -#include -#include - -namespace stlplus -{ - - //////////////////////////////////////////////////////////////////////////////// - // convert a real type to string - //////////////////////////////////////////////////////////////////////////////// - - // Only decimal radix is supported - - // The way in which the number is displayed is defined in radix_types.hpp - // Using any other value for the display type causes std::invalid_argument to be thrown - - void print_float(std::ostream& device, float f, - real_display_t display = display_mixed, - unsigned width = 0, - unsigned precision = 6) - throw(std::invalid_argument); - - void print_double(std::ostream& device, double f, - real_display_t display = display_mixed, - unsigned width = 0, - unsigned precision = 6) - throw(std::invalid_argument); - - //////////////////////////////////////////////////////////////////////////////// - -} // end namespace stlplus - -#endif +#ifndef STLPLUS_PRINT_FLOAT +#define STLPLUS_PRINT_FLOAT +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +// Convert a float/double to/from string + +//////////////////////////////////////////////////////////////////////////////// +#include "strings_fixes.hpp" +#include "format_types.hpp" +#include +#include +#include + +namespace stlplus +{ + + //////////////////////////////////////////////////////////////////////////////// + // convert a real type to string + //////////////////////////////////////////////////////////////////////////////// + + // Only decimal radix is supported + + // The way in which the number is displayed is defined in radix_types.hpp + // Using any other value for the display type causes std::invalid_argument to be thrown + + void print_float(std::ostream& device, float f, + real_display_t display = display_mixed, + unsigned width = 0, + unsigned precision = 6) + throw(std::invalid_argument); + + void print_double(std::ostream& device, double f, + real_display_t display = display_mixed, + unsigned width = 0, + unsigned precision = 6) + throw(std::invalid_argument); + + //////////////////////////////////////////////////////////////////////////////// + +} // end namespace stlplus + +#endif