lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [lmi-commits] master c01b9b0 02/22: Improve concinnity


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master c01b9b0 02/22: Improve concinnity
Date: Mon, 7 Jun 2021 16:37:10 +0200

On Sun,  6 Jun 2021 21:37:59 -0400 (EDT) Greg Chicares 
<gchicares@sbcglobal.net> wrote:

GC> branch: master
GC> commit c01b9b0ad03a823691fa39e7727a31efe1104f88
GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> 
GC>     Improve concinnity
GC> ---
GC>  zero.hpp | 14 +++++++-------
GC>  1 file changed, 7 insertions(+), 7 deletions(-)
GC> 
GC> diff --git a/zero.hpp b/zero.hpp
GC> index 8b69e4c..b3ec634 100644
GC> --- a/zero.hpp
GC> +++ b/zero.hpp
GC> @@ -258,19 +258,19 @@ root_type decimal_root
GC>      ,std::ostream&   os_trace = null_stream()
GC>      )
GC>  {
GC> -    os_trace.precision(DECIMAL_DIG);
GC> +    static constexpr double epsilon   
{std::numeric_limits<double>::epsilon()};
GC>  
GC> -    static double const epsilon = std::numeric_limits<double>::epsilon();
GC> +    round_to<double> const round_dec  {decimals, r_to_nearest};

 I believe that after replacing "const" with "constexpr", "static" has
become at least redundant and maybe even somewhat harmful, as it forces the
compiler to create the "epsilon" variable in the program, while without it
it could avoid doing this and just use it at compile time.

 So I think it should be just removed here -- but please let me know if you
see some reason to keep it.

 Thanks,
VZ

Attachment: pgpNi_leEi_WE.pgp
Description: PGP signature


reply via email to

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