how do I initialize a float to its max/min value?

Posted by Faken on Stack Overflow See other posts from Stack Overflow or by Faken
Published on 2010-04-21T16:09:13Z Indexed on 2010/04/21 16:23 UTC
Read the original article Hit count: 255

Filed under:
|

How do I hard code an absolute maximum or minimum value for a float or double? I want to search out the max/min of an array by simply iterating through and catching the largest.

There are also positive and negative infinity for floats, should I use those instead? If so, how do I denote that in my code?

© Stack Overflow or respective owner

Related posts about c++

Related posts about primitive-types