UI: Fix precision in float comparison helper
Use std::abs instead of abs to avoid loss in precision and also fix the corresponding warning from clang (3.5.0): warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] Closes jp9000/obs-studio#414
This commit is contained in:
parent
917daff6ec
commit
9cc56f2516
@ -59,6 +59,7 @@ static bool SceneItemHasVideo(obs_sceneitem_t *item)
|
|||||||
|
|
||||||
static bool CloseFloat(float a, float b, float epsilon=0.01)
|
static bool CloseFloat(float a, float b, float epsilon=0.01)
|
||||||
{
|
{
|
||||||
|
using std::abs;
|
||||||
return abs(a-b) <= epsilon;
|
return abs(a-b) <= epsilon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user