Skip to content

Commit

Permalink
Fix MSVC warning about trunction from double to float
Browse files Browse the repository at this point in the history
Specify the precision as float to avoid truncating from double.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
  • Loading branch information
nirbheek authored and mark4o committed Aug 22, 2020
1 parent f7e67d4 commit 034c1b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions celt/tests/test_unit_mathops.c
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 034c1b6

Please sign in to comment.