From faced34f8133e3a2c0b1f571f0d7a9a64282b280 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Jul 2015 11:27:28 +0200 Subject: qfc: use doubles for intermediate values We could lose precision when multiplying by integral_max with floats. For doubles, we can count on up to 2^56 - 1 to be expressible somewhat exactly. --- qfunctionconfigurator/functionconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qfunctionconfigurator') diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h index 74e20cf0..d49a8f7b 100644 --- a/qfunctionconfigurator/functionconfig.h +++ b/qfunctionconfigurator/functionconfig.h @@ -20,7 +20,7 @@ class Map { private: static constexpr int value_count = 5000; - using num = float; + using num = double; using integral = std::uint16_t; static constexpr integral integral_max = std::numeric_limits::max(); -- cgit v1.2.3