Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualbelfegor

Posted 03 April 2013 - 02:31 PM

You should first initialze min with some maximum float point value and max with minimum. and then do comparison in loop.

 

//float maxx = 0, maxy = 0, maxz = 0;
//float minx = 0, miny = 0, minz = 0;
float maxx = FLT_MIN, maxy = FLT_MIN, maxz = FLT_MIN;
float minx = FLT_MAX, miny = FLT_MAX, minz = FLT_MAX;

#1belfegor

Posted 03 April 2013 - 02:30 PM

You should first initialze min with some maximum float point value and max with minimum. and then do comparison in loop.

//float maxx = 0, maxy = 0, maxz = 0;
  //  float minx = 0, miny = 0, minz = 0;
float maxx = FLT_MIN, maxy = FLT_MIN, maxz = FLT_MIN;
    float minx = FLT_MAX, miny = FLT_MAX, minz = FLT_MAX;

PARTNERS