Thread: int / float MAX value ???

  1. #1

    Question int / float MAX value ???

    Could someone please tell what the maximum and minimum values are for both type int and float (easy question I know but I can't find a reference to it anywhere).

    Also, are INT_MAX and INT_MIN the equivalents?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Names defined in <limits.h> specifying the limits on the reanges of integral types.

    ---Type Name----|----Min Value------|------Max Value--
    ================|===================|============= ====
    signed char----|----SCHAR_MIN------|-----SCHAR_MAX---
    unsigned char--|---------0---------|-----UHAR_MAX----
    unsigned short-|---------0---------|-----USHRT_MAX---
    unsigned int---|---------0---------|-----UINT_MAX----
    unsigned long--|---------0---------|-----ULONG_MAX---

    now just print these with there format specifiers for example

    printf("signed char\nMAX: %c \nMIN: %c \n", SCHAR_MAX, SCHAR_MIN);

    these are the min and max value for your computer, (they are normally similar on most or all computers)

    Theres a neater attachement of the table


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  2. Drawing Program
    By Max_Payne in forum C++ Programming
    Replies: 21
    Last Post: 12-21-2007, 05:34 PM
  3. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 04:24 PM
  4. Converted from Dev-C++ 4 to Dev-C++ 5
    By Wraithan in forum C++ Programming
    Replies: 8
    Last Post: 12-03-2005, 07:45 AM
  5. Game of life
    By JoshR in forum C++ Programming
    Replies: 30
    Last Post: 04-03-2005, 02:17 PM