[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2c0ffba 4/4: Improve documentation
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2c0ffba 4/4: Improve documentation |
Date: |
Thu, 6 Apr 2017 09:17:43 -0400 (EDT) |
branch: master
commit 2c0ffbaa806a4cc48f71e0025915c8e080f5dd47
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Improve documentation
---
bourn_cast_test.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/bourn_cast_test.cpp b/bourn_cast_test.cpp
index 9cb6ba1..31a413b 100644
--- a/bourn_cast_test.cpp
+++ b/bourn_cast_test.cpp
@@ -338,12 +338,15 @@ void test_conv_fpint(char const* file, int line)
// Floating to integral.
- // Widening: not possible with standard arithmetic types.
+ // Widening: generally not possible with standard arithmetic
+ // types because long long int is 64 bits wide in practice, and
+ // the exponent for float (IEEE 754 binary32) is in [-126, +127].
// Narrowing.
- // Converting an integer-valued floating-point number to an
- // integral type preserves value: there is no truncation.
+ // An integer-valued floating-point number has no fractional part
+ // to truncate, so converting it to an integral type wide enough
+ // to represent it preserves value.
INVOKE_BOOST_TEST_EQUAL(I(3), bourn_cast<I>(F(3)), file, line);
// From positive zero.