[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 13da284 3/4: Improve documentation
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 13da284 3/4: Improve documentation |
Date: |
Mon, 26 Feb 2018 18:50:51 -0500 (EST) |
branch: master
commit 13da2843ef382938d40e5e3109f6838961b75817
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Improve documentation
---
numeric_io_traits.hpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/numeric_io_traits.hpp b/numeric_io_traits.hpp
index a509d79..93ea6a3 100644
--- a/numeric_io_traits.hpp
+++ b/numeric_io_traits.hpp
@@ -79,15 +79,16 @@ inline int floating_point_decimals(T t)
/// Simplify a formatted floating-point number.
///
-/// Precondition: 's' is a floating-point number formatted as if by
-/// std::snprintf() with format "%#.*f" or "%#.*Lf".
+/// Precondition: the argument is a floating-point number formatted as
+/// if by std::snprintf() with format "%#.*f" or "%#.*Lf". Therefore,
+/// it contains a decimal point (because of '#') preceded by at least
+/// one digit (because of 'f'). These preconditions are not tested:
+/// testing them would be costly, and this function is intended only
+/// for internal use in a context that ensures their satisfaction.
///
/// Returns: 's' without any insignificant characters (trailing zeros
/// after the decimal point, and the decimal point itself if followed
/// by no nonzero digits).
-///
-/// Note: The '#' flag ensures the presence of a decimal point in the
-/// argument, which this algorithm uses as a sentinel.
inline std::string simplify_floating_point(std::string const& s)
{