Thread: what is excess in floating point format

  1. #1
    Registered User
    Join Date
    Nov 2004

    what is excess in floating point format

    In a floating point format, why is an "excess" used?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    When there's too much?

    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jun 2004
    Do it yourself:
    int main(){
    	const int lfloat=0x7f7fffff;//max positive float in hex, 8 bit for expoent
    	const unsigned __int64 ldouble=0x7fefffffffffffff;//max positive double in hex, 11 bit for expoent
    	const float FMAX = *(const float*)&lfloat;
    	const double DMAX = *(const double*)&ldouble;
    	printf("FLOAT MAX: %f\nDOUBLE MAX: %lf\n",FMAX,DMAX);
    	return 0;
    FLOAT MAX: 340282346638528860000000000000000000000.000000
    DOUBLE MAX: 17976931348623157000000000000000000000000000000000000000000000000000
    1# Me thinks C++ currently doesn't suport by the standard 64bits ints
    2# __int64 is Microsofts compiler specific keyword. Use long long int for gcc. For Borland... I don't know.
    3# Raw C and pointer casting, anyone??
    4# Explicit hex values CANNOT be assigned to floating point numbers, so I used ints as auxiliaries
    5# To understand the hex values I assigned read this article from ieee about floating point number arithmetic.
    6# When all bits from the expoent are set, the number represents then not the number it suposed to be, but "NotANumber" or "Infinity". Overflow, division by zero, who knows?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 12:07 PM
  2. checking for floating point number
    By ssharish2005 in forum C Programming
    Replies: 6
    Last Post: 10-18-2005, 08:14 PM
  3. Understanding floating point
    By Eibro in forum A Brief History of
    Replies: 6
    Last Post: 05-11-2003, 03:58 PM
  4. Floating point faster than fixed-point
    By VirtualAce in forum A Brief History of
    Replies: 5
    Last Post: 11-08-2001, 11:34 PM
  5. Replies: 2
    Last Post: 09-10-2001, 12:00 PM