int / float MAX value ???

This is a discussion on int / float MAX value ??? within the C Programming forums, part of the General Programming Boards category; Could someone please tell what the maximum and minimum values are for both type int and float (easy question I ...

  1. #1
    spanky
    Guest

    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
    Location
    Australia
    Posts
    212
    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----
    char-----------|----CHAR_MIN-------|-----CHAR_MAX----
    short----------|----SHRT_MIN-------|-----SHRT_MAX----
    unsigned short-|---------0---------|-----USHRT_MAX---
    int------------|----INT_MIN--------|-----INT_MAX-----
    unsigned int---|---------0---------|-----UINT_MAX----
    long-----------|----LONG_MIN-------|-----LONG_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

    kwigibo
    Attached Files Attached Files

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, 09: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, 03:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21