[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"
- [lmi-commits] [lmi] valyuta/002 9a4b91d 51/65: Speed measurements, (continued)
- [lmi-commits] [lmi] valyuta/002 9a4b91d 51/65: Speed measurements, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 49f84a1 60/65: Don't convert type with operator=(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9a9665c 58/65: Record some speed improvements, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 ce34d89 04/65: improve, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 8331a5c 07/65: avoid catastrophic cancellation, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 0856081 20/65: improve currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 3d03e4a 41/65: fix typo, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 a00f68f 52/65: document, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 7de1baa 56/65: Note some more instances of the missing unary operator-(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 4d9fed5 15/65: document, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 5489e25 40/65: use data_type,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/002 a32e29b 53/65: Avoid implicit conversions, whose (hidden) cost is very high, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 39d842f 57/65: Simplify: catastrophic cancellation less worrisome with integer math, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 d124022 64/65: trace solves in self test, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 4f46dd5 59/65: Assert a precondition, Greg Chicares, 2020/09/16