To find max float no.

This is a discussion on To find max float no. within the C Programming forums, part of the General Programming Boards category; How can one find a maximum float number that can be stored on a particular machine without using built-in preprocessor ...

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    6

    To find max float no.

    How can one find a maximum float number that can be stored on a particular machine without using built-in preprocessor directives of header files i.e. without using FLT_MAX,etc. from float.h?

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    There is no standard way of doing it. You would have to know what the bit pattern representation of it was, and then load up the correct bits.

    http://research.microsoft.com/~holla...ieeefloat.html

  3. #3
    Helper
    Join Date
    Jun 2004
    Posts
    255
    Quote Originally Posted by Karam
    How can one find a maximum float number that can be stored on a particular machine without using built-in preprocessor directives of header files i.e. without using FLT_MAX,etc. from float.h?
    Why is the world would you do that ? The macros in <float.h> are designed for this purpose. What does prevent you to use them ?
    Emmanuel Delahaye

    "C is a sharp tool"

  4. #4
    Goscinny or Uderzo?
    Join Date
    Jun 2004
    Posts
    33
    Quote Originally Posted by Emmanuel Delaha
    Why is the world would you do that ? The macros in <float.h> are designed for this purpose. What does prevent you to use them ?
    Do I smell homework?

    I got that assignment a million times in college. TIP: you don't need to use your computer or programming at all to calculate it as long as your computer conforms to IEEE standards or you have access to the documentation of the format you're using (although of course you could write a program to perform the calculation for you).

    Study the link Thantos was so kind as to provide. You should be able to figure out what you need to do from there and the above tip
    Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?

    (How much wood would a wood chuck cut if a wood chuck could chuck wood?)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debug Error Really Quick Question
    By GCNDoug in forum C Programming
    Replies: 1
    Last Post: 04-23-2007, 12:05 PM
  2. Class won't call
    By Aalmaron in forum C++ Programming
    Replies: 3
    Last Post: 04-13-2006, 04:57 PM
  3. Multidimensional String
    By Beast() in forum C Programming
    Replies: 14
    Last Post: 07-03-2004, 12:47 AM
  4. help w/another program!!!
    By edshaft in forum C++ Programming
    Replies: 2
    Last Post: 12-17-2001, 10:34 AM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

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