lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 51c6865b 04/11: Use non-long double for duff_


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 51c6865b 04/11: Use non-long double for duff_fmt()
Date: Fri, 29 Apr 2022 11:59:32 -0400 (EDT)

branch: master
commit 51c6865b09183473e5daad0afb1ee59082bc915e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Use non-long double for duff_fmt()
    
    Long doubles are rarely formatted in lmi; doubles often are.
---
 duff_fmt.hpp      | 4 ++--
 duff_fmt_test.cpp | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/duff_fmt.hpp b/duff_fmt.hpp
index 7f5541ef..5b9a516f 100644
--- a/duff_fmt.hpp
+++ b/duff_fmt.hpp
@@ -36,9 +36,9 @@
 
 // Reference:
 // http://groups.google.com/groups?selm=38C9B681.B8A036DF%40flash.net
-inline std::string duff_fmt(long double value)
+inline std::string duff_fmt(double value)
 {
-    if(value < 0.0L)
+    if(value < 0.0)
         {
         return '-' + duff_fmt(-value);
         }
diff --git a/duff_fmt_test.cpp b/duff_fmt_test.cpp
index ac22e25a..b5dbcb31 100644
--- a/duff_fmt_test.cpp
+++ b/duff_fmt_test.cpp
@@ -133,13 +133,13 @@ int test_main(int, char*[])
     _control87(0x00ff,  0x00ff);
 #endif // defined __BORLANDC__
 
-    long double volatile d = 0.0;
+    double volatile d = 0.0;
     duff_fmt( 1.0 / d  );
     duff_fmt(-1.0 / d  );
 
-    if(std::numeric_limits<long double>::has_quiet_NaN)
+    if(std::numeric_limits<double>::has_quiet_NaN)
         {
-        duff_fmt(std::numeric_limits<long double>::quiet_NaN());
+        duff_fmt(std::numeric_limits<double>::quiet_NaN());
         }
 
     return 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]