Using data from float.h and limits, to find Some number limits for this system - C Data Type

C examples for Data Type:float

Description

Using data from float.h and limits, to find Some number limits for this system

Demo Code

#include <stdio.h>
#include <limits.h>    // integer limits
#include <float.h>     // floating-point limits

int main(void){    
    printf("Biggest int: %d\n", INT_MAX);
    printf("Smallest long long: %lld\n", LLONG_MIN);
    printf("One byte = %d bits on this system.\n", CHAR_BIT);
    printf("Largest double: %e\n", DBL_MAX);
    printf("Smallest normal float: %e\n", FLT_MIN);
    printf("float precision = %d digits\n", FLT_DIG);
    printf("float epsilon = %e\n", FLT_EPSILON);
    /*from  w  ww .j  av a 2s. co m*/
    return 0;
}

Result


Related Tutorials