diff options
author | 2020-12-01 18:27:07 +0100 | |
---|---|---|
committer | 2020-12-01 09:27:07 -0800 | |
commit | 68f4dd87d2814058ac34ca08061c7c27f42fda7e (patch) | |
tree | 5238358ea40976c0b9cde53b4af8a438a03dd483 /Source/Parser/wp_parser_y.h | |
parent | ae89e95c1636f28e2d88a93620c20f4c4acfbfeb (diff) | |
download | WarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.tar.gz WarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.tar.zst WarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.zip |
Fix some warnings related to double to float conversions (#1533)
* fixed several warnings related to double to float conversions
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Parser/wp_parser_y.h')
-rw-r--r-- | Source/Parser/wp_parser_y.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Parser/wp_parser_y.h b/Source/Parser/wp_parser_y.h index 796794039..dd02fb988 100644 --- a/Source/Parser/wp_parser_y.h +++ b/Source/Parser/wp_parser_y.h @@ -191,9 +191,9 @@ wp_call_f1 (enum wp_f1_t type, T a) case WP_COSH: return std::cosh(a); case WP_TANH: return std::tanh(a); case WP_ABS: return amrex::Math::abs(a); - case WP_POW_M3: return 1.0/(a*a*a); - case WP_POW_M2: return 1.0/(a*a); - case WP_POW_M1: return 1.0/a; + case WP_POW_M3: return amrex::Real(1.0)/(a*a*a); + case WP_POW_M2: return amrex::Real(1.0)/(a*a); + case WP_POW_M1: return amrex::Real(1.0)/a; case WP_POW_P1: return a; case WP_POW_P2: return a*a; case WP_POW_P3: return a*a*a; @@ -236,7 +236,7 @@ wp_call_f2 (enum wp_f2_t type, T a, T b) case WP_OR: return ((a != T(0)) || (b != T(0))) ? 1.0 : 0.0; case WP_HEAVISIDE: - return (a < 0.0) ? 0.0 : ((a > 0.0) ? 1.0 : b); + return (a < 0.0) ? amrex::Real(0.0) : ((a > 0.0) ? amrex::Real(1.0) : b); case WP_MIN: return (a < b) ? a : b; case WP_MAX: |