Thread: tan(pi/2) = infinity; now try to do this is C

  1. #16
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    hello

    taken from:
    dinkumware

    INFINITY

    #define INFINITY <float rvalue> [added with C99]

    The macro yields a float value that represents positive infinity.
    isfinite

    #define isfinite(x) <int rvalue> [added with C99, bool functions in C++]

  2. #17
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by cdalten
    C only supports floating point operations (IEEE format or whatever else). If you want fixed point operations, you have to implement it yourself.
    Sure. I'm not sure what the significance is to this thread though.
    Quote Originally Posted by cdalten
    Also, IEEE format is sign * mantissa *2^exponent. Remember, its base 2, not base 10.
    Incorrect. THe specification of floating point is in terms of sign*mantissa*10^exponent. The individual fields in the floating point variable (mantissa and exponent) will be represented in binary, but that doesn't mean floating point formats are specified as you have stated here.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Set ARRAY to INFINITY!
    By davewang in forum C Programming
    Replies: 13
    Last Post: 12-04-2008, 07:12 AM
  2. Integer infinity?
    By housguest in forum C Programming
    Replies: 1
    Last Post: 04-21-2008, 01:03 AM
  3. Replies: 7
    Last Post: 12-16-2006, 10:30 PM
  4. how to set value equal to infinity
    By Downnin in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2005, 04:14 PM
  5. infinity
    By Unregistered in forum C++ Programming
    Replies: 10
    Last Post: 06-01-2002, 01:35 PM