-
Notifications
You must be signed in to change notification settings - Fork 945
Closed
Description
We currently have the following implementation:
inline double linear_to_gamma(double linear_component)
{
return sqrt(linear_component);
}
This will barf on negative values, returning NaN. Should we harden this like so?
inline double linear_to_gamma(double linear_component)
{
if (linear_component < 0)
return 0;
return sqrt(linear_component);
}
or
inline double linear_to_gamma(double linear_component)
{
return sqrt(fmax(0, linear_component));
}