Skip to content

Commit

Permalink
Avoid more conversions to double
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmuizel committed Mar 30, 2011
1 parent faddc4c commit d204e2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iccread.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ static struct curveType *curve_from_table(uint16_t *table, int num_entries)

static uint16_t float_to_u8Fixed8Number(float a)
{
if (a > (255. + 255./256))
if (a > (255.f + 255.f/256))
return 0xffff;
else if (a < 0.)
else if (a < 0.f)
return 0;
else
return floor(a*256. + .5);
return floor(a*256.f + .5f);
}

static struct curveType *curve_from_gamma(float gamma)
Expand Down

0 comments on commit d204e2b

Please sign in to comment.