PDA

View Full Version : Floating Point Constants



johnmauer
7th February 2010, 22:05
Floating point constants are defined by compiler. For instance, Visual Studio uses DBL_EPSILON for the smallest difference. Does Qt do a translation for the obvious compilers, or should we define our own constant file?
Thanks.

Ginsengelf
8th February 2010, 08:25
Hi, have a look at std::numeric_limits (http://www.cplusplus.com/reference/std/limits/numeric_limits/) for a platform independent way to get those constants.

Ginsengelf

johnmauer
9th February 2010, 23:46
Thanks. I missed that for some reason. Talk about a blind spot. That's what I get for spending so much time with the same compiler.