Switch from abs to fabs

This commit is contained in:
Magnus Norddahl 2016-09-12 18:44:04 +02:00
parent 4e58e6626c
commit 01b1efe9ee
2 changed files with 4 additions and 4 deletions

View file

@ -1949,10 +1949,10 @@ class CommandAspectRatio : public SBarInfoCommandFlowControl
};
int ratio = ratioTypes[0].second;
float distance = abs(ratioTypes[0].first - aspect);
float distance = fabs(ratioTypes[0].first - aspect);
for (int i = 1; ratioTypes[i].first != 0.0f; i++)
{
float d = abs(ratioTypes[i].first - aspect);
float d = fabs(ratioTypes[i].first - aspect);
if (d < distance)
{
ratio = ratioTypes[i].second;

View file

@ -1681,10 +1681,10 @@ int CheckRatio (int width, int height, int *trueratio)
};
int ratio = ratioTypes[0].second;
float distance = abs(ratioTypes[0].first - aspect);
float distance = fabs(ratioTypes[0].first - aspect);
for (int i = 1; ratioTypes[i].first != 0.0f; i++)
{
float d = abs(ratioTypes[i].first - aspect);
float d = fabs(ratioTypes[i].first - aspect);
if (d < distance)
{
ratio = ratioTypes[i].second;