Do it yourself:
Code:
#include<stdio.h>
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;
}
/******************
OUTPUT
FLOAT MAX: 340282346638528860000000000000000000000.000000
DOUBLE MAX: 17976931348623157000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0.000000
*******************/
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?