lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/002 5489e25 40/65: use data_type


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/002 5489e25 40/65: use data_type
Date: Wed, 16 Sep 2020 16:55:18 -0400 (EDT)

branch: valyuta/002
commit 5489e255efce20acbab965556c54aac03558ed08
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    use data_type
---
 currency.hpp | 6 +++---
 round_to.hpp | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index 3b7e62a..91ec0f7 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -63,9 +63,9 @@ class currency
     currency(currency const&) = default;
     ~currency() = default;
 
-    explicit currency(double       d) : m_ {from_double(d)}           {}
-    explicit currency(int          i) : m_ {bourn_cast<data_type>(i)} {}
-    explicit currency(std::int64_t i) : m_ {bourn_cast<data_type>(i)} {}
+    explicit currency(double    d) : m_ {from_double(d)}           {}
+    explicit currency(int       i) : m_ {bourn_cast<data_type>(i)} {}
+    explicit currency(data_type i) : m_ {bourn_cast<data_type>(i)} {}
 
     currency& operator=(currency const&) = default;
     // IMPORTANT eventually suppress this? or both of these?
diff --git a/round_to.hpp b/round_to.hpp
index ebd8274..84772dc 100644
--- a/round_to.hpp
+++ b/round_to.hpp
@@ -390,7 +390,7 @@ inline currency round_to<RealType>::c(RealType r) const
         (rounding_function_(static_cast<RealType>(r * scale_fwd_)) * 
scale_back_c_
         );
     // include required headers
-    return currency(bourn_cast<std::int64_t>(z));
+    return currency(bourn_cast<currency::data_type>(z));
 #if 0
     // don't do this in production:
     if(z != std::trunc(z))
@@ -399,8 +399,8 @@ inline currency round_to<RealType>::c(RealType r) const
             << trunc(z) << "\n"
             << LMI_FLUSH
             ;
-    currency k(bourn_cast<std::int64_t>(z), true);
-    if(k.m() != bourn_cast<std::int64_t>(std::trunc(k.m())))
+    currency k(bourn_cast<currency::data_type>(z), true);
+    if(k.m() != bourn_cast<currency::data_type>(std::trunc(k.m())))
         warning()
             << k.m() << " does not equal\n"
             << trunc(bourn_cast<double>(k.m())) << "\n"



reply via email to

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