]> Dogcows Code - chaz/yoink/blobdiff - src/stlplus/strings/print_float.hpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / strings / print_float.hpp
diff --git a/src/stlplus/strings/print_float.hpp b/src/stlplus/strings/print_float.hpp
new file mode 100644 (file)
index 0000000..2de8b8f
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef STLPLUS_PRINT_FLOAT\r
+#define STLPLUS_PRINT_FLOAT\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+//   Author:    Andy Rushton\r
+//   Copyright: (c) Southampton University 1999-2004\r
+//              (c) Andy Rushton           2004-2009\r
+//   License:   BSD License, see ../docs/license.html\r
+\r
+//   Convert a float/double to/from string\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+#include "strings_fixes.hpp"\r
+#include "format_types.hpp"\r
+#include <string>\r
+#include <iostream>\r
+#include <stdexcept>\r
+\r
+namespace stlplus\r
+{\r
+\r
+  ////////////////////////////////////////////////////////////////////////////////\r
+  // convert a real type to string\r
+  ////////////////////////////////////////////////////////////////////////////////\r
+\r
+  // Only decimal radix is supported\r
+\r
+  // The way in which the number is displayed is defined in radix_types.hpp\r
+  // Using any other value for the display type causes std::invalid_argument to be thrown\r
+\r
+  void print_float(std::ostream& device, float f,\r
+                   real_display_t display = display_mixed,\r
+                   unsigned width = 0,\r
+                   unsigned precision = 6)\r
+    throw(std::invalid_argument);\r
+\r
+  void print_double(std::ostream& device, double f,\r
+                    real_display_t display = display_mixed,\r
+                    unsigned width = 0,\r
+                    unsigned precision = 6)\r
+    throw(std::invalid_argument);\r
+\r
+  ////////////////////////////////////////////////////////////////////////////////\r
+\r
+} // end namespace stlplus\r
+\r
+#endif\r
This page took 0.023248 seconds and 4 git commands to generate.