ThomasKroes / exposure-render

Automatically exported from code.google.com/p/exposure-render
106 stars 37 forks source link

Vec::Min/Max code broken #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
IS:

    HOD int Max(void)
    {
        T Max;

        for (int i = 1; i < Size; i++)
        {
            if (m_D[i] > m_D[i - 1])
                Max = m_D[i];
        }

        return Max;
    }

SHOULD BE:

T Max ** = m_D[0] **;
for (int i=1;i<Size;i++)
   if (m_D[i] > **Max**) 
       Max = m_D[i].

Same for min.

Original issue reported on code.google.com by ingow...@gmail.com on 11 Nov 2011 at 8:16