diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-08-12 16:08:31 +0300 |
---|---|---|
committer | Mark Harris <mark.hsj@gmail.com> | 2020-08-22 09:41:40 +0300 |
commit | 034c1b61a250457649d788bbf983b3f0fb63f02e (patch) | |
tree | 0f300980e647ff597abfdbe11840a3af965f3372 | |
parent | f7e67d429feb67c42b98c6d25f271524231b3cc3 (diff) |
Fix MSVC warning about trunction from double to float
Specify the precision as float to avoid truncating from double.
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
-rw-r--r-- | celt/tests/test_unit_mathops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/celt/tests/test_unit_mathops.c b/celt/tests/test_unit_mathops.c index 874e9adf..0615448d 100644 --- a/celt/tests/test_unit_mathops.c +++ b/celt/tests/test_unit_mathops.c @@ -143,7 +143,7 @@ void testbitexactlog2tan(void) void testlog2(void) { float x; - for (x=0.001;x<1677700.0;x+=(x/8.0)) + for (x=0.001f;x<1677700.0;x+=(x/8.0)) { float error = fabs((1.442695040888963387*log(x))-celt_log2(x)); if (error>0.0009) @@ -157,7 +157,7 @@ void testlog2(void) void testexp2(void) { float x; - for (x=-11.0;x<24.0;x+=0.0007) + for (x=-11.0;x<24.0;x+=0.0007f) { float error = fabs(x-(1.442695040888963387*log(celt_exp2(x)))); if (error>0.0002) @@ -171,7 +171,7 @@ void testexp2(void) void testexp2log2(void) { float x; - for (x=-11.0;x<24.0;x+=0.0007) + for (x=-11.0;x<24.0;x+=0.0007f) { float error = fabs(x-(celt_log2(celt_exp2(x)))); if (error>0.001) |