Results 1 to 3 of 3

Thread: Floating Point Constants

  1. #1
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Floating Point Constants

    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.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    509
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Floating Point Constants

    Hi, have a look at std::numeric_limits for a platform independent way to get those constants.

    Ginsengelf

  3. The following user says thank you to Ginsengelf for this useful post:

    johnmauer (9th February 2010)

  4. #3
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Floating Point Constants

    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.

Similar Threads

  1. Replies: 0
    Last Post: 22nd May 2009, 09:55
  2. Floating point exception.
    By dkt8154 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th November 2008, 08:26
  3. how can a pixel be a floating point number
    By babu198649 in forum General Programming
    Replies: 1
    Last Post: 2nd June 2008, 18:05
  4. Floating point imprecision
    By hardgeus in forum Qt Programming
    Replies: 5
    Last Post: 3rd August 2006, 15:29
  5. Replies: 3
    Last Post: 20th April 2006, 11:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.