Thread: max double, a la INT_MAX

  1. #1
    Registered User
    Join Date
    May 2003

    max double, a la INT_MAX

    I've been working on some projects involving prime-generation/factoring, during which I've been trying to keep close track of the numeric limits on the program. But I'm stumped on one part: is there a way to find the maximum value of the floating point types?

    It appears that limits.h only has info on integer types, and I wasn't having any luck with google.

  2. #2
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    float.h has FLT_MAX

  3. #3
    S Sang-drax's Avatar
    Join Date
    May 2002
    Göteborg, Sweden
    Use <limits> instead
    #include <limits>
    Last edited by Sang-drax; 01-30-2005 at 05:18 AM. Reason: spelling
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    On the topic of std::numeric_limits, has anyone ever tried using min()/max() together with including windows.h? There are some stupid min/max macros there that has to be undefined for numeric_limits to work...

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Or you #define NOMINMAX before including windows.h.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. expected primary expression
    By mju4t in forum C Programming
    Replies: 2
    Last Post: 03-27-2007, 06:59 PM
  2. Unknown Math Issues.
    By Sir Andus in forum C++ Programming
    Replies: 1
    Last Post: 03-06-2006, 06:54 PM
  3. Certain functions
    By Lurker in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2003, 01:26 AM
  4. Please HELP!!
    By traz in forum C++ Programming
    Replies: 4
    Last Post: 04-14-2003, 09:20 PM
  5. Hi, could someone help me with arrays?
    By goodn in forum C Programming
    Replies: 20
    Last Post: 10-18-2001, 09:48 AM